You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+17-18Lines changed: 17 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,21 +28,21 @@ and then, get the requirements by running
28
28
29
29
```
30
30
pip install -r requirements/requirements.txt
31
-
```
31
+
```
32
32
33
-
## Training and Classifying Audio files
33
+
## Choices
34
34
35
-
### Choices
35
+
### Feature options
36
36
37
-
Feature options :
38
-
You can choose between features `mfcc`, `gfcc`, `spectral`, `chroma` or any combination of those, example `gfcc,mfcc,spectral,chroma`, to extract from your audio files.
37
+
You can choose between features `mfcc`, `gfcc`, `spectral`, `chroma` or any combination of those, example `gfcc,mfcc,spectral,chroma`, to extract from your audio files for classification or just saving extracted feature for other uses.
39
38
40
-
Classifier options :
41
-
You can choose between `svm`, `svm_rbf`, `randomforest`, `logisticregression`, `knn`, `gradientboosting` and `extratrees`.
39
+
### Classifier options
42
40
41
+
You can choose between `svm`, `svm_rbf`, `randomforest`, `logisticregression`, `knn`, `gradientboosting` and `extratrees`.
43
42
Hyperparameter tuning is included in the code for each using grid search.
44
43
45
-
### Training and Testing Data structuring
44
+
45
+
## Training and Testing Data structuring
46
46
47
47
Let's say you have 2 classes that you have training data for (music and speech), and you want to use pyAudioProcessing to train a model using available feature options. Save each class as a directory and all the training audio .wav files under the respective class directories. Example:
48
48
@@ -83,9 +83,13 @@ If you want to classify audio samples without any known labels, structure the da
83
83
│ ├── sample2.wav
84
84
```
85
85
86
+
## Training and Classifying Audio files
87
+
88
+
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.
89
+
86
90
### Examples
87
91
88
-
Code example of using `gfcc,spectral,chroma` feature and `svm` classifier. Sample data can be found [here](https://github.com/jsingh811/pyAudioProcessing/tree/master/data_samples).
92
+
Code example of using `gfcc,spectral,chroma` feature and `svm` classifier. Sample data can be found [here](https://github.com/jsingh811/pyAudioProcessing/tree/master/data_samples). Please refer to the section on [Training and Testing Data structuring](https://github.com/jsingh811/pyAudioProcessing#training-and-testing-data-structuring) to use your own data instead.
89
93
```
90
94
from pyAudioProcessing.run_classification import train_and_classify
The above logs the filename where the classification results are saved along with the details about testing files and the classifier used.
102
106
103
107
104
-
If you cloned the project via git, the following command line example of doing training and classification with `gfcc,spectral,chroma` features and `svm` classifier can be used as well. Sample data can be found [here](https://github.com/jsingh811/pyAudioProcessing/tree/master/data_samples).
108
+
If you cloned the project via git, the following command line example of training and classification with `gfcc,spectral,chroma` features and `svm` classifier can be used as well. Sample data can be found [here](https://github.com/jsingh811/pyAudioProcessing/tree/master/data_samples). Please refer to the section on [Training and Testing Data structuring](https://github.com/jsingh811/pyAudioProcessing#training-and-testing-data-structuring) to use your own data instead.
105
109
106
110
Training:
107
111
```
@@ -117,16 +121,11 @@ Classification results get saved in `classifier_results.json`.
117
121
118
122
## Extracting features from audios
119
123
120
-
This feature lets the user extract aggregated data features calculated per audio file.
121
-
122
-
### Choices
123
-
124
-
Feature options :
125
-
You can choose between features `mfcc`, `gfcc`, `spectral`, `chroma` or any combination of those to extract from your audio files.
124
+
This feature lets the user extract aggregated data features calculated per audio file. See [feature options](https://github.com/jsingh811/pyAudioProcessing#feature-options) for more information on choices of features available.
126
125
127
126
### Examples
128
127
129
-
Code example for performing `gfcc` and `mfcc` feature extraction can be found below. To use your own audio data for feature extraction, pass the path to `get_features` in place of `data_samples/testing`. Please refer to the format of directory `data_samples/testing`.
128
+
Code example for performing `gfcc` and `mfcc` feature extraction can be found below. To use your own audio data for feature extraction, pass the path to `get_features` in place of `data_samples/testing`. Please refer to the format of directory `data_samples/testing` or the section on [Training and Testing Data structuring](https://github.com/jsingh811/pyAudioProcessing#training-and-testing-data-structuring).
130
129
131
130
```
132
131
from pyAudioProcessing.extract_features import get_features
If you cloned the project via git, the following command line example of for `gfcc` and `mfcc` feature extractions can be used as well. The features argument should be a comma separated string, example `gfcc,mfcc`.
151
-
To use your own audio files for feature extraction and pass in the directory containing .wav files as the `-d` argument. Please refer to the format of directory `data_samples/testing`.
150
+
To use your own audio files for feature extraction, pass in the directory path containing .wav files as the `-f` argument. Please refer to the format of directory `data_samples/testing` or the section on [Training and Testing Data structuring](https://github.com/jsingh811/pyAudioProcessing#training-and-testing-data-structuring).
0 commit comments