sudo apt-get install python-skimage sudo pip install svgwrite sudo apt-get install python-pywt
This library can be used for general image classification and feature extraction.
python featureExtraction.py -featuresFile sampledata/spectrograms/music/m_5_r_139.png
python featureExtraction.py -featuresFilesCompare sampledata/spectrograms/music/m_5_r_139.png sampledata/spectrograms/speech/kill_bill_2_speech_17.png
python featureExtraction.py -featuresDir sampledata/spectrograms2/music/
python featureExtraction.py -featuresDirs spectrograms sampledata/spectrograms/music sampledata/spectrograms/speech
(Features are stored in file "sectrograms_features")
Models are trained from samples stored in folders (one folder per class).
Examples:
- kNN model training
python train.py -train knn knnSpeechMusicSpecs sampledata/spectrograms/music sampledata/spectrograms/speech
The above example trains a kNN classification model, does cross validation to estimate the best parameter (k value) and stores the model in a file (named knn3Classes).
- SVM model training
python train.py -train svm svmSpeechMusicSpecs sampledata/spectrograms/music sampledata/spectrograms/speech
The above example trains an SVM classification model, does cross validation to estimate the best parameter (C value) and stores the model in a file (named svmSentimentAds).
python train.py -classifyFile knn knnSpeechMusicSpecs sampledata/music.melodies_snatch_0081.png
python train.py -classifyFile knn knnSpeechMusicSpecs sampledata/s_30_r_335.png