|
2 | 2 |
|
3 | 3 |  |
4 | 4 |
|
5 | | -A Python based library for processing audio data into features and building Machine Learning models. |
| 5 | +A Python based library for processing audio data into features (GFCC, MFCC, spectral, chroma) and building Machine Learning models. |
6 | 6 | This was written using `Python 3.7.6`, and has been tested to work with Python >= 3.6, <4. |
7 | 7 |
|
8 | 8 |
|
@@ -35,7 +35,7 @@ If you are on Python 3.9 and experience any issues with the code samples regardi |
35 | 35 | pip install -U numpy |
36 | 36 | ``` |
37 | 37 |
|
38 | | -## Choices |
| 38 | +## Options |
39 | 39 |
|
40 | 40 | ### Feature options |
41 | 41 |
|
@@ -88,6 +88,32 @@ If you want to classify audio samples without any known labels, structure the da |
88 | 88 | │ ├── sample2.wav |
89 | 89 | ``` |
90 | 90 |
|
| 91 | +## Classifying with Pre-trained Models |
| 92 | + |
| 93 | +There are three models that have been pre-trained and provided in this project under the /models directory. They are as follows. |
| 94 | + |
| 95 | +`music genre`: Contains SVM classifier to classify audio into 10 music genres - blues, classical, country, disco, hiphop, jazz, metal, pop, reggae, rock. This classifier was trained using mfcc, gfcc, spectral and chroma features. In order to classify your audio files using this classifier, please follow the audio files structuring guidelines. The following commands in Python can be used to classify your data. |
| 96 | + |
| 97 | +`musicVSspeech`: Contains SVM classifier that classifying audio into two possible classes - music and speech. This classifier was trained using mfcc, spectral and chroma features. |
| 98 | + |
| 99 | +`musicVSspeechVSbirds`: Contains SVM classifier that classifying audio into three possible classes - music, speech and birds. This classifier was trained using mfcc, spectral and chroma features. |
| 100 | + |
| 101 | +In order to classify your audio files using any of these classifier, please follow the audio files [structuring guidelines](https://github.com/jsingh811/pyAudioProcessing#training-and-testing-data-structuring). The following commands in Python can be used to classify your data. |
| 102 | + |
| 103 | +``` |
| 104 | +from pyAudioProcessing.run_classification import train_and_classify |
| 105 | +
|
| 106 | +# musicVSspeech classification |
| 107 | +train_and_classify("../test_data", "classify", ["spectral", "chroma", "mfcc"], "svm", "models/musicVSspeech/svm_clf") |
| 108 | +
|
| 109 | +# musicVSspeechVSbirds classification |
| 110 | +train_and_classify("../test_data", "classify", ["spectral", "chroma", "mfcc"], "svm", "models/musicVSspeechVSbirds/svm_clf") |
| 111 | +
|
| 112 | +# music genre classification |
| 113 | +train_and_classify("../test_data", "classify", ["gfcc", "spectral", "chroma", "mfcc"], "svm", "models/music genre/svm_clf") |
| 114 | +``` |
| 115 | + |
| 116 | + |
91 | 117 | ## Training and Classifying Audio files |
92 | 118 |
|
93 | 119 | Audio data can be trained, tested and classified using pyAudioProcessing. Please see [feature options](https://github.com/jsingh811/pyAudioProcessing#feature-options) and [classifier model options](https://github.com/jsingh811/pyAudioProcessing#classifier-options) for more information. |
|
0 commit comments