-
Notifications
You must be signed in to change notification settings - Fork 39
/
seq2seq_decode_torch.sh
executable file
·57 lines (46 loc) · 2.2 KB
/
seq2seq_decode_torch.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
#!/bin/bash -
#===============================================================================
#
# FILE: decode_aho.sh
#
# USAGE: ./decode_aho.sh params_dir basename
#
# DESCRIPTION:
#
# OPTIONS: ---
# REQUIREMENTS: ---
# BUGS: ---
# NOTES: ---
# AUTHOR: YOUR NAME (),
# ORGANIZATION:
# CREATED: 09/11/16 18:14
# REVISION: ---
#===============================================================================
set -o nounset # Treat unset variables as an error
# Run predictions
#python seq2seq_decode_prediction.py
#PARAMS_DIR="$1"
# PARAMS_DIR='data/test/predicted/SF1-TF1'
PARAMS_DIR='tcstar_data_trim/test/torch_predicted/'
while read TRG_SPK <&5; do
while read SRC_SPK <&4; do
# while read BASENAME <&3; do
for file in ${PARAMS_DIR}${SRC_SPK}-${TRG_SPK}/*.dat; do
BASENAME=$(basename "${file}")
echo $BASENAME >> ${PARAMS_DIR}${SRC_SPK}-${TRG_SPK}.list
done
cat ${PARAMS_DIR}${SRC_SPK}-${TRG_SPK}.list | cut -d'.' -f1 | sort | uniq > ${PARAMS_DIR}${SRC_SPK}-${TRG_SPK}_uniq.list
while read BASENAME <&3; do
# Convert parameters to float data
echo 'Convert parameters to float data'
x2x +af ${PARAMS_DIR}${SRC_SPK}-${TRG_SPK}/${BASENAME}.vf.dat > ${PARAMS_DIR}${SRC_SPK}-${TRG_SPK}/${BASENAME}.vf
x2x +af ${PARAMS_DIR}${SRC_SPK}-${TRG_SPK}/${BASENAME}.lf0.dat > ${PARAMS_DIR}${SRC_SPK}-${TRG_SPK}/${BASENAME}.lf0
cat ${PARAMS_DIR}${SRC_SPK}-${TRG_SPK}/${BASENAME}.mcp.dat | do_columns.pl -c 1 | x2x +af > ${PARAMS_DIR}${SRC_SPK}-${TRG_SPK}/${BASENAME}.mcp
mkdir -p ${PARAMS_DIR}${SRC_SPK}-${TRG_SPK}/wav
# Decode parameters
echo 'Decode parameters'
ahodecoder16_64 ${PARAMS_DIR}${SRC_SPK}-${TRG_SPK}/${BASENAME}.lf0 ${PARAMS_DIR}${SRC_SPK}-${TRG_SPK}/${BASENAME}.mcp ${PARAMS_DIR}${SRC_SPK}-${TRG_SPK}/${BASENAME}.vf ${PARAMS_DIR}${SRC_SPK}-${TRG_SPK}/wav/${BASENAME}.wav
echo "Decoded ${BASENAME}"
done 3< ${PARAMS_DIR}${SRC_SPK}-${TRG_SPK}_uniq.list
done 4< 'tcstar_data_trim/test/src_speakers.list'
done 5< 'tcstar_data_trim/test/trg_speakers.list'