- Download ffmpeg from ffmpeg, you should select
Static
linking and get a zip file. - extract the zip file into
ffmpeg
folder, so that there existsffmpeg/bin/ffmeg.exe
.
- Download sox from SOund eXchange, you should get a zip file.
- extract zip file into the sox folder. so that there exists sox/sox.exe.
Convert recorded audio files to *.wav files
$ python ./convert_file.py ../../data
The data augmentation server is implemented by grpc.
$ pip install grpcio
or for some version of python3
$ pip3 install grpcio
Training involes two files: train.py
and augmentation/
.
$ python -m augmentation
will start a augmentation server that provide train data and test data.
train.py
will connect to augmentation server and request data.
augmentation/config.py
is used for configuring the batch size/thread size/data source/...
Before training, there are several things you should do.
-
convert raw audio files to uniformed *.wave files for training.
-
split data into two part: train, validate
-
put train data into
data/train/
-
put validate data into
data/test/
-
NOTE: the wav file must be encoded by 16 bit signed integer, mono-channeled and at a sampling rate of 16000.
-
see audioPlot for converting tools.
- gain
sox
from SOund eXchange, you should get a zip file. - extract zip file into the
sox
folder. so that there existssox/sox.exe
.
server side: $python -m augmentation
client side: $python train.py
- NOTE: run it from the folder
audioNet
** Resume a interrupted training process.
You can resume from certain checkpoint, modify the last line of train.py
, change -1
to your start point.
modify webfront.py
, change MODEL_ID
to yours.
open a web browser and input URL:http://127.0.0.1:5000/predict.
*It requires [ffmpeg](https://ffmpeg.org/)
for audio file format convertion.
** Select Checkpoint for Evaluation
modify webfront.py
, change MODEL_ID
to yours.
- Modify webfront.py, change "MODEL_ID=XX".
- start a web server andand input URL: http://127.0.0.1:5000/predict.
$ python ./webfront.py
- Convert model file *.h5 to *.pb file
- Place your *.pb file where you want to deploy.
- See Android mobile example: androidAudioRecg
$ python ./create_pb.py XX