This my entry to the clarity enhancement challenge to enhance speech for the hearing impaired.
- install docker https://docs.docker.com/engine/install/ubuntu/
- clone this repo
git clone https://github.com/kenders2000/u_net_speech_enhancement.git
- Build the container image, add your username to the build command. This will pass through the permissions required to read and write as that user within the container. This will pull the latest tensorflow-gpu image and build upon that. This will work for both gpu and non gpu machines. Note this will pull the latest clarity challenge repo into the image.
docker build --build-arg USR=username --build-arg UID=$(id -u) --build-arg GID=$(id -g) -f clarity.dockerfile -t username:tf-clarity .
- run the container, attach the u_net_speech_enhancement folder.
docker run --volume=/path/to/u_net_speech_enhancement:/home/ubuntu/u_net_speech_enhancement --volume=/path/to/data:/home/ubuntu/data -p 8888:8888 -it username:tf-clarity zsh
- additional environment steps:
Setup all the symlinks, in the following we point to the data in
/home/username/u_net_speech_enhancement/example_data
this contains a few examples
from the dev set of the clarity challenge, if you have the full data set, replace
this with the path to parent folder of the clarity_CEC1_data
folder.
(cd /home/username/u_net_speech_enhancement/env && ./make_links.sh username /home/username/u_net_speech_enhancement/example_data)
Set up the openMHA binaries to be easily executable.
source /home/kenders/clarity_CEC1/tools/openMHA/bin/thismha.sh
Note: I do not use the Clarity virutal env, but to activate that if required:
source ${CLARITY_ROOT}/env/bin/activate
python train_unet.py -c /path/to/model_checkpoints
python predict_with_trained_unet.py -p /path/to/trained_model -d <dataset>
Saves into the clarity repo via the symlink, into the appropriate dataset dir.
to predict using the example dataset:
python predict_with_trained_unet.py -p /path/to/trained_model -d dev
python post_process_cleaned_audio_eval.py -u <username>
python post_process_cleaned_audio_eval.py -p /path/to/trained_model -d <dataset> -i /path/to/cleaned_data -o /path/to/write_hearing_aid_files -s /path/to/clarity/dataset