Skip to content

Commit 3e42a99

Browse files
committed
Update readme
1 parent becfd6b commit 3e42a99

File tree

1 file changed

+17
-18
lines changed

1 file changed

+17
-18
lines changed

README.md

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,21 @@ and then, get the requirements by running
2828

2929
```
3030
pip install -r requirements/requirements.txt
31-
```
31+
```
3232

33-
## Training and Classifying Audio files
33+
## Choices
3434

35-
### Choices
35+
### Feature options
3636

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.
3938

40-
Classifier options :
41-
You can choose between `svm`, `svm_rbf`, `randomforest`, `logisticregression`, `knn`, `gradientboosting` and `extratrees`.
39+
### Classifier options
4240

41+
You can choose between `svm`, `svm_rbf`, `randomforest`, `logisticregression`, `knn`, `gradientboosting` and `extratrees`.
4342
Hyperparameter tuning is included in the code for each using grid search.
4443

45-
### Training and Testing Data structuring
44+
45+
## Training and Testing Data structuring
4646

4747
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:
4848

@@ -83,9 +83,13 @@ If you want to classify audio samples without any known labels, structure the da
8383
│   ├── sample2.wav
8484
```
8585

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+
8690
### Examples
8791

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.
8993
```
9094
from pyAudioProcessing.run_classification import train_and_classify
9195
# Training
@@ -101,7 +105,7 @@ train_and_classify("data_samples/testing", "classify", ["gfcc", "spectral", "chr
101105
The above logs the filename where the classification results are saved along with the details about testing files and the classifier used.
102106

103107

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.
105109

106110
Training:
107111
```
@@ -117,16 +121,11 @@ Classification results get saved in `classifier_results.json`.
117121

118122
## Extracting features from audios
119123

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.
126125

127126
### Examples
128127

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).
130129

131130
```
132131
from pyAudioProcessing.extract_features import get_features
@@ -148,7 +147,7 @@ utils.write_to_json("audio_features.json",features)
148147
```
149148

150149
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).
152151

153152
```
154153
python pyAudioProcessing/extract_features.py -f "data_samples/testing" -feats "gfcc,mfcc"

0 commit comments

Comments
 (0)