Open SimonF89 opened 7 years ago
From your previous comments I understand that you are interested in "real-time" classification on the input buffer. GaiaTransform relies on pre-trained models and you can train your own models using scripts in Gaia. However, the easiest solution is to use our pre-trained classifier models. To use them it is necessary to compute the same descriptors as MusicExtractor computes and then apply GaiaTransform. The MusicExtractor is not well suited for your purpose as it requires an input audio file.
We are in the process of refactoring MusicExtractor in music_extractor_refactor branch. It is now possible to run MusicExtractor as an algorithm in python, but we still have to re-train our classifier models because of some updates we did for some of the music descriptors.
In your case, as a workaround and if speed is not an issue, you could store input buffers to a file in real time and then run the command-line version of the MusicExtractor using os.system call in python. This way you will be able to re-use our old pre-trained models.
To build command line music extractor (assuming you are on linux):
./waf configure --with-python --with-examples --with-gaia
sudo ./waf install
highlevel:
compute: 1
svm_models: ['svm_models/genre_tzanetakis.history', 'svm_models/mood_sad.history']
Now you can run command-line extractor like this (and you can do that from python using os.system call):
/usr/local/bin/essentia_streaming_extractor_music foo.wav foo.sig profile
We will consider modifications to MusicExtractor to allow computation from any audio input, not limited to an audio file. However, keep in mind that many of our classifier models were trained on complete audio tracks, others on 30 second fragments, and we are unaware of how robust they are for shorter audio fragments.
Awesome! Thx a lot! =)
Iam looking forward to use the modified MusicExtractor in the future, but for now this workaround will work!
Thank you =)
At least, one last question: Could you write a short example of the usage of gaiatransform in python? I would like to train some Classifiers on my one and execute them in my code. I didnt found any examples and wasnt able to get it working on my own...
Thank you a lot for your quick help! =)
Hi, could you post a example for the gaiatransform in python? Iam running crazy... I want to extract these features:
may you help me with this problem and maybe post a short example? Thx!!! =)