-
Notifications
You must be signed in to change notification settings - Fork 322
/
Copy pathprepare.sh
executable file
·70 lines (56 loc) · 1.73 KB
/
prepare.sh
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/usr/bin/env bash
set -eou pipefail
stage=-1
stop_stage=100
. local/parse_options.sh || exit 1
mkdir -p data
if [ $stage -le -1 ] && [ $stop_stage -ge -1 ]; then
echo "stage -1: Download LM"
mkdir -p data/lm
./local/download_lm.py
fi
if [ $stage -le 0 ] && [ $stop_stage -ge 0 ]; then
echo "stage 0: Download data"
# If you have pre-downloaded it to /path/to/LibriSpeech,
# you can create a symlink to avoid downloading it again:
#
# ln -sfv /path/to/LibriSpeech data/
#
mkdir -p data/LibriSpeech
if [ ! -f data/LibriSpeech/train-other-500/.completed ]; then
# It's compatible with kaldi's egs/librispeech/s5/local/download_and_untar.sh
./local/download_data.py
fi
# If you have pre-downloaded it to /path/to/musan,
# you can create a symlink to avoid downloading it again:
#
# ln -s /path/to/musan data/
#
if [ ! -e data/musan ]; then
wget https://www.openslr.org/resources/17/musan.tar.gz
fi
fi
if [ $stage -le 1 ] && [ $stop_stage -ge 1 ]; then
echo "Stage 1: Prepare librispeech manifest"
# We assume that you have downloaded the librispeech corpus
# to data/LibriSpeech
mkdir -p data/manifests
./local/prepare_librispeech_manifest.py
fi
if [ $stage -le 2 ] && [ $stop_stage -ge 2 ]; then
echo "Stage 2: Prepare musan manifest"
# We assume that you have downloaded the musan corpus
# to data/musan
mkdir -p data/manifests
./local/prepare_musan_manifest.py
fi
if [ $stage -le 3 ] && [ $stop_stage -ge 3 ]; then
echo "Stage 3: Compute fbank for librispeech"
mkdir -p data/fbank
./local/compute_fbank_librispeech.py
fi
if [ $stage -le 4 ] && [ $stop_stage -ge 4 ]; then
echo "Stage 4: Compute fbank for librispeech"
mkdir -p data/fbank
./local/compute_fbank_musan.py
fi