-
Notifications
You must be signed in to change notification settings - Fork 0
/
deep-speaker
executable file
·54 lines (41 loc) · 1.42 KB
/
deep-speaker
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/env bash
set -e
HOME_DIR=$(eval echo "~")
WORKING_DIR="${HOME_DIR}/.deep-speaker-wd"
if [ $# -lt 1 ]; then
echo "Usage : $0 Task [download_librispeech, build_mfcc, build_model_inputs, train_softmax, train_triplet]"
exit
fi
PRE_TRAINING_WORKING_DIR="${WORKING_DIR}/pre-training"
TRIPLET_TRAINING_WORKING_DIR="${WORKING_DIR}/triplet-training"
mkdir -p "${WORKING_DIR}"
case "$1" in
download_librispeech)
echo "[download_librispeech] selected."
# WORKING_DIR/LibriSpeech
cp download_librispeech.sh "${WORKING_DIR}"
cd "${WORKING_DIR}" && bash download_librispeech.sh && cd -
;;
build_mfcc)
echo "[build_mfcc] selected."
python cli.py build-mfcc-cache --working_dir "${PRE_TRAINING_WORKING_DIR}" --audio_dir "${WORKING_DIR}/LibriSpeech/train-clean-360"
python cli.py build-mfcc-cache --working_dir "${TRIPLET_TRAINING_WORKING_DIR}" --audio_dir "${WORKING_DIR}/LibriSpeech"
;;
build_model_inputs)
echo "[build_model_inputs] selected."
python cli.py build-keras-inputs --working_dir "${PRE_TRAINING_WORKING_DIR}"
;;
train_softmax)
# Pre-training (0.92k speakers).
echo "[train_softmax] selected."
python cli.py train-model --working_dir "${PRE_TRAINING_WORKING_DIR}" --pre_training_phase
;;
train_triplet)
# Triplet-training (2.48k speakers).
echo "[train_triplet] selected."
python cli.py train-model --working_dir "${TRIPLET_TRAINING_WORKING_DIR}"
;;
*)
echo "Unknown option."
;;
esac