Allows to train a personalised wakeword model thanks to OpenWakeWord.
It modifies a bit the provided great python notebook so that you can use it directly as a automatic_model_training.py
file (then you can use it without any IPython kernel).
For now it is not available on MacOS (because of piper-phonemize library), then you will have to train it on a Linux platform.
A set of scripts are available in this repository to rapidly configure a remote machine.
git clone [email protected]:ericbdc/wakeword.git
cd wakeword
First you need a running Linux platform available, e.g.: AWS EC2 Ubuntu (all runs in ~30min on a t3.2xlarge).
In that case, you will generate a Key Pair, name it wakeword
and download the wakeword.pem
file to your ~/.ssh/
folder.
Check you can connect through ssh, replace user@ip
with yours:
ssh -i ~/.ssh/wakeword.pem [email protected]
Copy useful scripts
./send_to_remote.sh 'ec2-xx-xx-xx-xxx.eu-west-3.compute.amazonaws.com'
Do the basic setup on the remote machine
ssh -i ~/.ssh/wakeword.pem [email protected] ./setup_remote.sh
Better launch the script in a Linux screen
screen -S wakeword
ssh -i ~/.ssh/wakeword.pem [email protected] python automatic_model_training.py | at now -m
You can detach your screen session by doing Ctrl+A Ctrl+D.
If you want to re-attach your screen do screen -R wakeword
.
To exit your screen do exit
and press Enter. You will lose the shell outputs as screen launchs a subshell.
Activate the venv and install dev requirements locally
python -m venv venv
source venv/bin/activate
pip install -r requirements-dev.txt
jupyter nbconvert automatic_model_training.ipynb --to python
If you made any change, you will need to copy it again to your remote machine.
python detect_from_microphone.py --inference_framework=onnx --model_path='my_custom_model/simbad.onnx'