-
Notifications
You must be signed in to change notification settings - Fork 7
/
prep_gentle.sh
executable file
·47 lines (40 loc) · 1.43 KB
/
prep_gentle.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
#!/usr/bin/env bash
#
# Create environment tree for training acoustic models with Kaldi.
#
# Grupo FalaBrasil (2020)
# Federal University of Pará (UFPA)
#
# Author: Nov 2020
# Cassio Batista - https://cassota.gitlab.io
utils/check_dependencies.sh || exit 1
src_dir=$(readlink -f fb-gentle)
if test $# -ne 1 ; then
echo "usage: $0 [options] <proj_dir>"
echo " <proj_dir> path for your project *within* kaldi/egs dir."
echo " e.g.: ./$0 ${HOME}/kaldi/egs/MEUPROJETO"
exit 1
fi
proj_dir="$1"
if [ -d "$proj_dir" ] ; then
echo -n "$0: warning: dir '$proj_dir' exists. Overwrite? [y/N] "
read ans
if [ "$ans" != "y" ] ; then
echo "$0: aborted." && exit 0
else
rm -rf $proj_dir/s5/{data,exp,mfcc,conf,fblocal,fbutils}
fi
# https://stackoverflow.com/questions/8426058/getting-the-parent-of-a-directory-in-bash
elif [ "$(basename $(readlink -f $(dirname "$proj_dir")))" != "egs" ] ; then
echo "$0: error: '$proj_dir' must be inside /path/to/kaldi/egs"
exit 1
fi
KALDI_ROOT="$(readlink -f $(dirname "$(dirname "$proj_dir")"))"
aspire_dir=$KALDI_ROOT/egs/aspire/s5
proj_dir="$(readlink -f "$proj_dir")"/s5
mkdir -p $proj_dir
ln -sf $src_dir/{run.sh,conf,fblocal,fbutils} $proj_dir
ln -sf $aspire_dir/{path.sh,local,steps,utils} $proj_dir
sed 's/"queue.pl/"run.pl/g' $aspire_dir/cmd.sh > $proj_dir/cmd.sh
tree -C $proj_dir -I 'corpus|RIRS_NOISES|data|mfcc*|exp' 2> /dev/null
echo "$0: all set up! check out your project at '$proj_dir'"