JosephTheMoUSE / MoUSE-GUI

MIT License
7 stars 1 forks source link

Require Separate Spectrograms for Multiple Audio Files #27

Open Sabah98 opened 8 months ago

Sabah98 commented 8 months ago

I am trying to use the MoUSE Desktop APP for USV detection in rodents for my graduate research at the University of South Carolina. For our use case, we require individual spectrograms for each audio file. The mouse app supports loading multiple audio files but it generates one concatenated spectrogram of all the loaded audio files. Also, loading a large number of files results in the app crashing with an error message given below. Would it be possible to update the code to facilitate separate spectrograms for multiple audio files?

(mouseapp) evana_anis@MacBook-Pro mouseapp_test % python3 main.py
Support/MoUSE/l/project_data.h5Exception raised: ``/Users/evana_anis/Library/Application Support/MoUSE/l/project_data.h5`` does not exist
/Users/evana_anis/opt/anaconda3/envs/mouseapp/lib/python3.8/site-packages/mouseapp/context_manager.py:29: DeprecationWarning: 'exec_' will be removed in the future. Use 'exec' instead.
  sys.exit(application.exec_())
zsh: killed     python3 main.py
Zhylkaaa commented 8 months ago

Hey @Sabah98, nice to hear that someone actually found our app and using it. I presume you have more than a bunch of files, since the most likely reason for system kill is OOM (running out of memory trying to generate and store the whole spectrogram in memory). We were anticipating this might happen, but never found a use case for that....that is until now :)

Could you tell as more about what you are trying to achieve, so we can think about solutions for this problem? Now many files are you trying to add? what is mean/min/max duration of the file + sample rate

Sabah98 commented 7 months ago

Hi @Zhylkaaa, thank you for responding to my issue. I have found your app and neural network detector to be really useful. Let me give you a bit more context on my project.

I am collaborating with the UofSC School of Medicine and trying to analyze their rodent USV data of different experiments. One of the experiments in the dataset contains 29 audio (.wav) files, each for one rodent. The mean/min/max duration and sample rate of these files are as follows: Sampling rate: 250000 Duration: 417.071104 seconds Mean Duration: 413.06836676923075 seconds Min Duration: 356.51584 seconds Max Duration: 428.081152 seconds

My goal with the app is to load all of these 29 audio files, and then for each of the 29 files, generate a separate spectrogram, run detection with neural network, and export detected annotations. Right now, when I load multiple files in the app (let's say 5), the app generates one concatenated spectrogram for all the 5 audio files. So, when I load 29 files, it possibly runs out of memory as you have said. It would be really nice, if an option could be added to iterate over multiple files get the detected annotations for each file separately.