diff --git a/egs/reverb/s5/RESULTS b/egs/reverb/s5/RESULTS index 2bfda91a6a9..b92f144b458 100644 --- a/egs/reverb/s5/RESULTS +++ b/egs/reverb/s5/RESULTS @@ -44,3 +44,78 @@ exp/chain_tr_simu_8ch/tdnn1a_sp/decode_test_tg_5k_et* %WER 3.18 [ 188 / 5907, 25 ins, 38 del, 125 sub ] exp/chain_tr_simu_8ch/tdnn1a_sp/decode_test_tg_5k_et_simu_1ch/wer_8_1.0_near_room1 %WER 4.87 [ 303 / 6226, 31 ins, 64 del, 208 sub ] exp/chain_tr_simu_8ch/tdnn1a_sp/decode_test_tg_5k_et_simu_1ch/wer_9_1.0_near_room2 %WER 4.84 [ 284 / 5868, 23 ins, 64 del, 197 sub ] exp/chain_tr_simu_8ch/tdnn1a_sp/decode_test_tg_5k_et_simu_1ch/wer_10_1.0_near_room3 + +######################################## +GMM RESULTs with WPE and Beamformit: +exp/tri3/decode_dt_real_1ch +%WER 27.48 [ 402 / 1463, 39 ins, 63 del, 300 sub ] exp/tri3/decode_dt_real_1ch/wer_14_0.5_far_room1 +%WER 22.33 [ 358 / 1603, 37 ins, 90 del, 231 sub ] exp/tri3/decode_dt_real_1ch/wer_16_0.0_near_room1 + +exp/tri3/decode_dt_simu_1ch +%WER 4.47 [ 182 / 4071, 35 ins, 26 del, 121 sub ] exp/tri3/decode_dt_simu_1ch/wer_14_0.0_far_room1 +%WER 6.78 [ 275 / 4058, 41 ins, 37 del, 197 sub ] exp/tri3/decode_dt_simu_1ch/wer_17_0.0_far_room2 +%WER 5.27 [ 213 / 4045, 27 ins, 32 del, 154 sub ] exp/tri3/decode_dt_simu_1ch/wer_13_1.0_far_room3 +%WER 4.54 [ 185 / 4071, 34 ins, 24 del, 127 sub ] exp/tri3/decode_dt_simu_1ch/wer_15_0.0_near_room1 +%WER 5.54 [ 225 / 4058, 32 ins, 27 del, 166 sub ] exp/tri3/decode_dt_simu_1ch/wer_15_0.5_near_room2 +%WER 5.59 [ 226 / 4045, 29 ins, 37 del, 160 sub ] exp/tri3/decode_dt_simu_1ch/wer_14_0.5_near_room3 + +exp/tri3/decode_et_real_1ch +%WER 20.97 [ 621 / 2962, 113 ins, 79 del, 429 sub ] exp/tri3/decode_et_real_1ch/wer_13_0.0_far_room1 +%WER 21.65 [ 678 / 3131, 77 ins, 138 del, 463 sub ] exp/tri3/decode_et_real_1ch/wer_16_1.0_near_room1 + +exp/tri3/decode_et_simu_1ch +%WER 5.54 [ 327 / 5907, 65 ins, 40 del, 222 sub ] exp/tri3/decode_et_simu_1ch/wer_16_0.5_far_room1 +%WER 7.48 [ 466 / 6226, 64 ins, 61 del, 341 sub ] exp/tri3/decode_et_simu_1ch/wer_15_0.5_far_room2 +%WER 7.11 [ 417 / 5868, 64 ins, 64 del, 289 sub ] exp/tri3/decode_et_simu_1ch/wer_14_0.5_far_room3 +%WER 5.50 [ 325 / 5907, 58 ins, 44 del, 223 sub ] exp/tri3/decode_et_simu_1ch/wer_17_1.0_near_room1 +%WER 6.23 [ 388 / 6226, 60 ins, 52 del, 276 sub ] exp/tri3/decode_et_simu_1ch/wer_15_0.5_near_room2 +%WER 7.09 [ 416 / 5868, 67 ins, 60 del, 289 sub ] exp/tri3/decode_et_simu_1ch/wer_14_0.5_near_room3 + +exp/tri3/decode_dt_real_2ch_beamformit +%WER 25.91 [ 379 / 1463, 32 ins, 72 del, 275 sub ] exp/tri3/decode_dt_real_2ch_beamformit/wer_16_1.0_far_room1 +%WER 21.46 [ 344 / 1603, 36 ins, 87 del, 221 sub ] exp/tri3/decode_dt_real_2ch_beamformit/wer_17_0.0_near_room1 + +exp/tri3/decode_dt_simu_2ch_beamformit +%WER 4.91 [ 200 / 4071, 42 ins, 26 del, 132 sub ] exp/tri3/decode_dt_simu_2ch_beamformit/wer_17_0.0_far_room1 +%WER 6.38 [ 259 / 4058, 35 ins, 38 del, 186 sub ] exp/tri3/decode_dt_simu_2ch_beamformit/wer_15_1.0_far_room2 +%WER 5.12 [ 207 / 4045, 34 ins, 29 del, 144 sub ] exp/tri3/decode_dt_simu_2ch_beamformit/wer_13_1.0_far_room3 +%WER 5.21 [ 212 / 4071, 56 ins, 27 del, 129 sub ] exp/tri3/decode_dt_simu_2ch_beamformit/wer_16_0.0_near_room1 +%WER 5.32 [ 216 / 4058, 30 ins, 33 del, 153 sub ] exp/tri3/decode_dt_simu_2ch_beamformit/wer_17_1.0_near_room2 +%WER 5.07 [ 205 / 4045, 35 ins, 26 del, 144 sub ] exp/tri3/decode_dt_simu_2ch_beamformit/wer_14_0.0_near_room3 + +exp/tri3/decode_et_real_2ch_beamformit +%WER 17.45 [ 517 / 2962, 74 ins, 91 del, 352 sub ] exp/tri3/decode_et_real_2ch_beamformit/wer_17_0.5_far_room1 +%WER 18.78 [ 588 / 3131, 88 ins, 99 del, 401 sub ] exp/tri3/decode_et_real_2ch_beamformit/wer_16_0.5_near_room1 + +exp/tri3/decode_et_simu_2ch_beamformit +%WER 5.43 [ 321 / 5907, 63 ins, 44 del, 214 sub ] exp/tri3/decode_et_simu_2ch_beamformit/wer_17_1.0_far_room1 +%WER 6.75 [ 420 / 6226, 50 ins, 62 del, 308 sub ] exp/tri3/decode_et_simu_2ch_beamformit/wer_14_1.0_far_room2 +%WER 6.87 [ 403 / 5868, 75 ins, 47 del, 281 sub ] exp/tri3/decode_et_simu_2ch_beamformit/wer_13_0.0_far_room3 +%WER 5.59 [ 330 / 5907, 70 ins, 46 del, 214 sub ] exp/tri3/decode_et_simu_2ch_beamformit/wer_17_1.0_near_room1 +%WER 5.89 [ 367 / 6226, 45 ins, 62 del, 260 sub ] exp/tri3/decode_et_simu_2ch_beamformit/wer_17_1.0_near_room2 +%WER 6.61 [ 388 / 5868, 55 ins, 67 del, 266 sub ] exp/tri3/decode_et_simu_2ch_beamformit/wer_17_0.5_near_room3 + +exp/tri3/decode_dt_real_8ch_beamformit +%WER 19.75 [ 289 / 1463, 41 ins, 38 del, 210 sub ] exp/tri3/decode_dt_real_8ch_beamformit/wer_15_1.0_far_room1 +%WER 15.41 [ 247 / 1603, 27 ins, 47 del, 173 sub ] exp/tri3/decode_dt_real_8ch_beamformit/wer_15_1.0_near_room1 + +exp/tri3/decode_dt_simu_8ch_beamformit +%WER 4.77 [ 194 / 4071, 39 ins, 27 del, 128 sub ] exp/tri3/decode_dt_simu_8ch_beamformit/wer_17_0.5_far_room1 +%WER 5.45 [ 221 / 4058, 46 ins, 24 del, 151 sub ] exp/tri3/decode_dt_simu_8ch_beamformit/wer_16_0.0_far_room2 +%WER 4.20 [ 170 / 4045, 25 ins, 26 del, 119 sub ] exp/tri3/decode_dt_simu_8ch_beamformit/wer_13_1.0_far_room3 +%WER 4.91 [ 200 / 4071, 55 ins, 20 del, 125 sub ] exp/tri3/decode_dt_simu_8ch_beamformit/wer_14_0.0_near_room1 +%WER 5.22 [ 212 / 4058, 33 ins, 26 del, 153 sub ] exp/tri3/decode_dt_simu_8ch_beamformit/wer_15_1.0_near_room2 +%WER 4.08 [ 165 / 4045, 28 ins, 20 del, 117 sub ] exp/tri3/decode_dt_simu_8ch_beamformit/wer_13_1.0_near_room3 + +exp/tri3/decode_et_real_8ch_beamformit +%WER 14.38 [ 426 / 2962, 72 ins, 71 del, 283 sub ] exp/tri3/decode_et_real_8ch_beamformit/wer_15_1.0_far_room1 +%WER 13.86 [ 434 / 3131, 68 ins, 70 del, 296 sub ] exp/tri3/decode_et_real_8ch_beamformit/wer_17_1.0_near_room1 + +exp/tri3/decode_et_simu_8ch_beamformit +%WER 5.59 [ 330 / 5907, 87 ins, 36 del, 207 sub ] exp/tri3/decode_et_simu_8ch_beamformit/wer_14_1.0_far_room1 +%WER 6.10 [ 380 / 6226, 51 ins, 55 del, 274 sub ] exp/tri3/decode_et_simu_8ch_beamformit/wer_15_1.0_far_room2 +%WER 6.24 [ 366 / 5868, 57 ins, 51 del, 258 sub ] exp/tri3/decode_et_simu_8ch_beamformit/wer_14_1.0_far_room3 +%WER 5.62 [ 332 / 5907, 74 ins, 44 del, 214 sub ] exp/tri3/decode_et_simu_8ch_beamformit/wer_16_1.0_near_room1 +%WER 5.73 [ 357 / 6226, 56 ins, 57 del, 244 sub ] exp/tri3/decode_et_simu_8ch_beamformit/wer_17_1.0_near_room2 +%WER 5.93 [ 348 / 5868, 62 ins, 52 del, 234 sub ] exp/tri3/decode_et_simu_8ch_beamformit/wer_14_1.0_near_room3 +######################################## diff --git a/egs/reverb/s5/conf/reverb_beamformit.cfg b/egs/reverb/s5/conf/reverb_beamformit.cfg new file mode 100755 index 00000000000..70fdd858651 --- /dev/null +++ b/egs/reverb/s5/conf/reverb_beamformit.cfg @@ -0,0 +1,50 @@ +#BeamformIt sample configuration file for AMI data (http://groups.inf.ed.ac.uk/ami/download/) + +# scrolling size to compute the delays +scroll_size = 250 + +# cross correlation computation window size +window_size = 500 + +#amount of maximum points for the xcorrelation taken into account +nbest_amount = 4 + +#flag wether to apply an automatic noise thresholding +do_noise_threshold = 1 + +#Percentage of frames with lower xcorr taken as noisy +noise_percent = 10 + +######## acoustic modelling parameters + +#transition probabilities weight for multichannel decoding +trans_weight_multi = 25 +trans_weight_nbest = 25 + +### + +#flag wether to print the feaures after setting them, or not +print_features = 1 + +#flag wether to use the bad frames in the sum process +do_avoid_bad_frames = 1 + +#flag to use the best channel (SNR) as a reference +#defined from command line +do_compute_reference = 1 + +#flag wether to use a uem file or not(process all the file) +do_use_uem_file = 0 + +#flag wether to use an adaptative weights scheme or fixed weights +do_adapt_weights = 1 + +#flag wether to output the sph files or just run the system to create the auxiliary files +do_write_sph_files = 1 + +####directories where to store/retrieve info#### +#channels_file = ./cfg-files/channels + +#show needs to be passed as argument normally, here a default one is given just in case +#show_id = Ttmp + diff --git a/egs/reverb/s5/local/get_results.sh b/egs/reverb/s5/local/get_results.sh index 7eb632dc40f..28aa15bb604 100755 --- a/egs/reverb/s5/local/get_results.sh +++ b/egs/reverb/s5/local/get_results.sh @@ -3,6 +3,7 @@ # "Our baselines" echo "########################################" echo "GMM RESULTs:" +dt_real_2ch_beamformit dt_simu_2ch_beamformit et_real_2ch_beamformit et_simu_2ch_beamformit dt_real_8ch_beamformit dt_simu_8ch_beamformit et_real_8ch_beamformit et_simu_8ch_beamformit echo "exp/tri3/decode_dt_real_1ch" cat exp/tri3/decode_dt_real_1ch/scoring_kaldi/best_wer* echo "" @@ -14,6 +15,30 @@ cat exp/tri3/decode_et_real_1ch/scoring_kaldi/best_wer* echo "" echo "exp/tri3/decode_et_simu_1ch" cat exp/tri3/decode_et_simu_1ch/scoring_kaldi/best_wer* +echo "" +echo "exp/tri3/decode_dt_real_2ch_beamformit" +cat exp/tri3/decode_dt_real_2ch_beamformit/scoring_kaldi/best_wer* +echo "" +echo "exp/tri3/decode_dt_simu_2ch_beamformit" +cat exp/tri3/decode_dt_simu_2ch_beamformit/scoring_kaldi/best_wer* +echo "" +echo "exp/tri3/decode_et_real_2ch_beamformit" +cat exp/tri3/decode_et_real_2ch_beamformit/scoring_kaldi/best_wer* +echo "" +echo "exp/tri3/decode_et_simu_2ch_beamformit" +cat exp/tri3/decode_et_simu_2ch_beamformit/scoring_kaldi/best_wer* +echo "" +echo "exp/tri3/decode_dt_real_8ch_beamformit" +cat exp/tri3/decode_dt_real_8ch_beamformit/scoring_kaldi/best_wer* +echo "" +echo "exp/tri3/decode_dt_simu_8ch_beamformit" +cat exp/tri3/decode_dt_simu_8ch_beamformit/scoring_kaldi/best_wer* +echo "" +echo "exp/tri3/decode_et_real_8ch_beamformit" +cat exp/tri3/decode_et_real_8ch_beamformit/scoring_kaldi/best_wer* +echo "" +echo "exp/tri3/decode_et_simu_8ch_beamformit" +cat exp/tri3/decode_et_simu_8ch_beamformit/scoring_kaldi/best_wer* echo "########################################" echo "TDNN RESULTs:" echo "exp/chain_tr_simu_8ch/tdnn1a_sp/decode_test_tg_5k_dt*" diff --git a/egs/reverb/s5/local/prepare_real_data.sh b/egs/reverb/s5/local/prepare_real_data.sh index d7019697fc4..2880d4bb195 100755 --- a/egs/reverb/s5/local/prepare_real_data.sh +++ b/egs/reverb/s5/local/prepare_real_data.sh @@ -1,6 +1,7 @@ #!/bin/bash # -# Copyright 2018 Johns Hopkins University (Author: Shinji Watanabe) +# Copyright 2018 Johns Hopkins University (Author: Shinji Watanabe) +# Copyright 2018 Johns Hopkins University (Author: Aswin Shanmugam Subramanian) # Apache 2.0 # This script is adapted from data preparation scripts in the Kaldi reverb recipe # https://github.com/kaldi-asr/kaldi/tree/master/egs/reverb/s5/local @@ -124,3 +125,14 @@ for nch in 1 2 8; do done done +for nch in 2 8; do + for task in dt et; do + datadir=data/${task}_real_${nch}ch_beamformit + mkdir -p ${datadir} + sort ${dir}/${task}_real_1ch_wpe_wav.scp | sed -e "s/-[1-8]_/-bf${nch}_/" > ${datadir}/wav.scp + sort ${dir}/${task}_real_1ch.txt > ${datadir}/text + sort ${dir}/${task}_real_1ch.utt2spk > ${datadir}/utt2spk + sort ${dir}/${task}_real_1ch.spk2utt > ${datadir}/spk2utt + ./utils/fix_data_dir.sh ${datadir} + done +done diff --git a/egs/reverb/s5/local/prepare_simu_data.sh b/egs/reverb/s5/local/prepare_simu_data.sh index 1047e6b5cca..b5c6001062c 100755 --- a/egs/reverb/s5/local/prepare_simu_data.sh +++ b/egs/reverb/s5/local/prepare_simu_data.sh @@ -1,6 +1,7 @@ #!/bin/bash # -# Copyright 2018 Johns Hopkins University (Author: Shinji Watanabe) +# Copyright 2018 Johns Hopkins University (Author: Shinji Watanabe) +# Copyright 2018 Johns Hopkins University (Author: Aswin Shanmugam Subramanian) # Apache 2.0 # This script is adapted from data preparation scripts in the Kaldi reverb recipe # https://github.com/kaldi-asr/kaldi/tree/master/egs/reverb/s5/local @@ -89,7 +90,11 @@ for nch in 1 2 8; do for task in tr dt et; do datadir=data/${task}_simu_${nch}ch mkdir -p ${datadir} - sort ${dir}/${task}_simu_${nch}ch_wpe_wav.scp > ${datadir}/wav.scp + if [ ${task} == 'tr' ]; then + sort ${dir}/${task}_simu_${nch}ch_wav.scp > ${datadir}/wav.scp + else + sort ${dir}/${task}_simu_${nch}ch_wpe_wav.scp > ${datadir}/wav.scp + fi sort ${dir}/${task}_simu_${nch}ch.txt > ${datadir}/text sort ${dir}/${task}_simu_${nch}ch.utt2spk > ${datadir}/utt2spk sort ${dir}/${task}_simu_${nch}ch.spk2utt > ${datadir}/spk2utt @@ -97,3 +102,14 @@ for nch in 1 2 8; do done done +for nch in 2 8; do + for task in dt et; do + datadir=data/${task}_simu_${nch}ch_beamformit + mkdir -p ${datadir} + sort ${dir}/${task}_simu_1ch_wpe_wav.scp | sed -e "s/ch1/bf${nch}/" > ${datadir}/wav.scp + sort ${dir}/${task}_simu_1ch.txt > ${datadir}/text + sort ${dir}/${task}_simu_1ch.utt2spk > ${datadir}/utt2spk + sort ${dir}/${task}_simu_1ch.spk2utt > ${datadir}/spk2utt + ./utils/fix_data_dir.sh ${datadir} + done +done diff --git a/egs/reverb/s5/local/run_beamform.sh b/egs/reverb/s5/local/run_beamform.sh new file mode 100755 index 00000000000..0549b2e34f2 --- /dev/null +++ b/egs/reverb/s5/local/run_beamform.sh @@ -0,0 +1,142 @@ +#!/bin/bash + +# Copyright 2015, Mitsubishi Electric Research Laboratories, MERL (Author: Shinji Watanabe) +# Copyright 2018, Johns Hopkins University (Author: Aswin Shanmugam Subramanian) + +. ./cmd.sh +. ./path.sh + +# Config: +nj=20 +cmd=run.pl + +. utils/parse_options.sh || exit 1; + +if [ $# != 1 ]; then + echo "Wrong #arguments ($#, expected 1)" + echo "Usage: local/run_beamform.sh [options] " + echo "main options (for others, see top of script file)" + echo " --nj # number of parallel jobs" + echo " --cmd # Command to run in parallel with" + exit 1; +fi + +odir=$1 +dir=${PWD}/data/local/data + +if [ -z $BEAMFORMIT ] ; then + export BEAMFORMIT=$KALDI_ROOT/tools/extras/BeamformIt +fi +export PATH=${PATH}:$BEAMFORMIT +! hash BeamformIt && echo "Missing BeamformIt, run 'cd ../../../tools/; extras/install_beamformit.sh;'" && exit 1 + +# Set bash to 'debug' mode, it will exit on : +# -e 'error', -u 'undefined variable', -o ... 'error in pipeline', -x 'print commands', +set -e +set -u +set -o pipefail + +for task in dt et; do + for nch in 2 8; do + wdir=exp/beamform_real_${task}_${nch}ch + mkdir -p $wdir/log + arrays=$wdir/channels + output_wavfiles=$wdir/wavfiles.list + if [ ${nch} == 2 ]; then + allwavs=`cat ${dir}/${task}_real_${nch}ch_wpe_wav.scp | cut -d " " -f2` + allwavs_beamformit=`cat data/${task}_real_${nch}ch_beamformit/wav.scp | cut -d " " -f2` + echo $allwavs | tr ' ' '\n' | rev | sort | rev | awk 'NR%2==1' > $wdir/channels.1st + echo $allwavs | tr ' ' '\n' | rev | sort | rev | awk 'NR%2==0' > $wdir/channels.2nd + echo $allwavs_beamformit | tr ' ' '\n' | rev | sort | rev | awk -F 'WPE/' '{print $2}' | awk -F '.wav' '{print $1}' > $output_wavfiles + paste -d" " $output_wavfiles $wdir/channels.1st $wdir/channels.2nd > $arrays + elif [ ${nch} == 8 ]; then + allwavs=`cat ${dir}/${task}_real_${nch}ch_wpe_wav.scp | cut -d " " -f2` + allwavs_beamformit=`cat data/${task}_real_${nch}ch_beamformit/wav.scp | cut -d " " -f2` + echo $allwavs | tr ' ' '\n' | rev | sort | rev | awk 'NR%8==1' > $wdir/channels.1st + echo $allwavs | tr ' ' '\n' | rev | sort | rev | awk 'NR%8==2' > $wdir/channels.2nd + echo $allwavs | tr ' ' '\n' | rev | sort | rev | awk 'NR%8==3' > $wdir/channels.3rd + echo $allwavs | tr ' ' '\n' | rev | sort | rev | awk 'NR%8==4' > $wdir/channels.4th + echo $allwavs | tr ' ' '\n' | rev | sort | rev | awk 'NR%8==5' > $wdir/channels.5th + echo $allwavs | tr ' ' '\n' | rev | sort | rev | awk 'NR%8==6' > $wdir/channels.6th + echo $allwavs | tr ' ' '\n' | rev | sort | rev | awk 'NR%8==7' > $wdir/channels.7th + echo $allwavs | tr ' ' '\n' | rev | sort | rev | awk 'NR%8==0' > $wdir/channels.8th + echo $allwavs_beamformit | tr ' ' '\n' | rev | sort | rev | awk -F 'WPE/' '{print $2}' | awk -F '.wav' '{print $1}' > $output_wavfiles + paste -d" " $output_wavfiles $wdir/channels.1st $wdir/channels.2nd $wdir/channels.3rd $wdir/channels.4th $wdir/channels.5th $wdir/channels.6th $wdir/channels.7th $wdir/channels.8th > $arrays + fi + # split the list for parallel processing + split_wavfiles="" + for n in `seq $nj`; do + split_wavfiles="$split_wavfiles $output_wavfiles.$n" + done + utils/split_scp.pl $output_wavfiles $split_wavfiles || exit 1; + + echo -e "Beamforming - $task - real - $nch ch\n" + # making a shell script for each job + for n in `seq $nj`; do + cat <<-EOF > $wdir/log/beamform.$n.sh + while read line; do + $BEAMFORMIT/BeamformIt -s \$line -c $arrays \ + --config_file `pwd`/conf/reverb_beamformit.cfg \ + --result_dir $odir + done < $output_wavfiles.$n + EOF + done + + chmod a+x $wdir/log/beamform.*.sh + $cmd JOB=1:$nj $wdir/log/beamform.JOB.log \ + $wdir/log/beamform.JOB.sh + done +done + +for task in dt et; do + for nch in 2 8; do + wdir=exp/beamform_simu_${task}_${nch}ch + mkdir -p $wdir/log + arrays=$wdir/channels + output_wavfiles=$wdir/wavfiles.list + if [ ${nch} == 2 ]; then + allwavs=`cat ${dir}/${task}_simu_${nch}ch_wpe_wav.scp | grep "ch[1-2].wav" | cut -d " " -f2` + allwavs_beamformit=`cat data/${task}_simu_${nch}ch_beamformit/wav.scp | grep "bf2.wav" | cut -d " " -f2` + echo $allwavs | tr ' ' '\n' | grep 'ch1' | sort > $wdir/channels.1st + echo $allwavs | tr ' ' '\n' | grep 'ch2' | sort > $wdir/channels.2nd + echo $allwavs_beamformit | tr ' ' '\n' | awk -F 'WPE/' '{print $2}' | sort | awk -F '.wav' '{print $1}' > $output_wavfiles + paste -d" " $output_wavfiles $wdir/channels.1st $wdir/channels.2nd > $arrays + elif [ ${nch} == 8 ]; then + allwavs=`cat ${dir}/${task}_simu_${nch}ch_wpe_wav.scp | grep "ch[1-8].wav" | cut -d " " -f2` + allwavs_beamformit=`cat data/${task}_simu_${nch}ch_beamformit/wav.scp | grep "bf8.wav" | cut -d " " -f2` + echo $allwavs | tr ' ' '\n' | grep 'ch1' | sort > $wdir/channels.1st + echo $allwavs | tr ' ' '\n' | grep 'ch2' | sort > $wdir/channels.2nd + echo $allwavs | tr ' ' '\n' | grep 'ch3' | sort > $wdir/channels.3rd + echo $allwavs | tr ' ' '\n' | grep 'ch4' | sort > $wdir/channels.4th + echo $allwavs | tr ' ' '\n' | grep 'ch5' | sort > $wdir/channels.5th + echo $allwavs | tr ' ' '\n' | grep 'ch6' | sort > $wdir/channels.6th + echo $allwavs | tr ' ' '\n' | grep 'ch7' | sort > $wdir/channels.7th + echo $allwavs | tr ' ' '\n' | grep 'ch8' | sort > $wdir/channels.8th + echo $allwavs_beamformit | tr ' ' '\n' | awk -F 'WPE/' '{print $2}' | sort | awk -F '.wav' '{print $1}' > $output_wavfiles + paste -d" " $output_wavfiles $wdir/channels.1st $wdir/channels.2nd $wdir/channels.3rd $wdir/channels.4th $wdir/channels.5th $wdir/channels.6th $wdir/channels.7th $wdir/channels.8th > $arrays + fi + # split the list for parallel processing + split_wavfiles="" + for n in `seq $nj`; do + split_wavfiles="$split_wavfiles $output_wavfiles.$n" + done + utils/split_scp.pl $output_wavfiles $split_wavfiles || exit 1; + + echo -e "Beamforming - $task - simu - $nch ch\n" + # making a shell script for each job + for n in `seq $nj`; do + cat <<-EOF > $wdir/log/beamform.$n.sh + while read line; do + $BEAMFORMIT/BeamformIt -s \$line -c $arrays \ + --config_file `pwd`/conf/reverb_beamformit.cfg \ + --result_dir $odir + done < $output_wavfiles.$n + EOF + done + + chmod a+x $wdir/log/beamform.*.sh + $cmd JOB=1:$nj $wdir/log/beamform.JOB.log \ + $wdir/log/beamform.JOB.sh + done +done +echo "`basename $0` Done." diff --git a/egs/reverb/s5/local/run_wpe.py b/egs/reverb/s5/local/run_wpe.py index dc8c40878f4..9c5e14c107e 100644 --- a/egs/reverb/s5/local/run_wpe.py +++ b/egs/reverb/s5/local/run_wpe.py @@ -1,3 +1,6 @@ +# Copyright 2018 Johns Hopkins University (Author: Aswin Shanmugam Subramanian) +# Apache 2.0 + import numpy as np import soundfile as sf import time diff --git a/egs/reverb/s5/local/run_wpe.sh b/egs/reverb/s5/local/run_wpe.sh index 1203469abd4..77ff6fffb31 100755 --- a/egs/reverb/s5/local/run_wpe.sh +++ b/egs/reverb/s5/local/run_wpe.sh @@ -1,4 +1,6 @@ #!/bin/bash +# Copyright 2018 Johns Hopkins University (Author: Aswin Shanmugam Subramanian) +# Apache 2.0 . ./cmd.sh . ./path.sh diff --git a/egs/reverb/s5/run.sh b/egs/reverb/s5/run.sh index a633db8e222..3d651e639a9 100755 --- a/egs/reverb/s5/run.sh +++ b/egs/reverb/s5/run.sh @@ -2,6 +2,7 @@ # Copyright 2013-2014 MERL (author: Felix Weninger and Shinji Watanabe) # Johns Hopkins University (author: Szu-Jui Chen) +# Johns Hopkins University (author: Aswin Shanmugam Subramanian) # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -58,7 +59,7 @@ fi #training set and test set train_set=tr_simu_8ch -test_sets="dt_real_1ch dt_simu_1ch et_real_1ch et_simu_1ch" +test_sets="dt_real_1ch dt_simu_1ch et_real_1ch et_simu_1ch dt_real_2ch_beamformit dt_simu_2ch_beamformit et_real_2ch_beamformit et_simu_2ch_beamformit dt_real_8ch_beamformit dt_simu_8ch_beamformit et_real_8ch_beamformit et_simu_8ch_beamformit" # The language models with which to decode (tg_5k or bg_5k) lm="tg_5k" @@ -70,7 +71,7 @@ decode_nj=10 if [ ${stage} -le 1 ]; then # data preparation - wavdir=$PWD/wav + wavdir=${PWD}/wav echo "stage 0: Data preparation" local/generate_data.sh --wavdir ${wavdir} ${wsjcam0} local/prepare_simu_data.sh --wavdir ${wavdir} ${reverb} ${wsjcam0} @@ -79,6 +80,7 @@ fi if [ $stage -le 2 ]; then local/run_wpe.sh + local/run_beamform.sh ${wavdir}/WPE/ fi if [ $stage -le 3 ]; then