diff --git a/egs2/TEMPLATE/enh1/README.md b/egs2/TEMPLATE/enh1/README.md index 2d7e7aa542b..1b9984979d4 100644 --- a/egs2/TEMPLATE/enh1/README.md +++ b/egs2/TEMPLATE/enh1/README.md @@ -40,6 +40,7 @@ Format scp files such as `wav.scp`. The scp files include: + `spk{}.scp`: wav file list of speech reference signals. {} can be 1, 2, ..., depending on the number of speakers in the input signal in `wav.scp`. + `noise{}.scp` (optional): wav file list of noise reference signals. {} can be 1, 2, ..., depending on the number of noise types in the input signal in `wav.scp`. The file(s) are required when `--use_noise_ref true` is specified. Also related to the variable `noise_type_num`. + `dereverb{}.scp` (optional): wav file list of dereverberation reference signals (for training a dereverberation model). This file is required when `--use_dereverb_ref true` is specified. Also related to the variable `dereverb_ref_num`. + + `utt2category`: (optional) the category info of each utterance. This file can help the batch sampler to load the same category utterances in each batch. One usage case is that users want to load the simulation data and real data in different batches. #### Stage 4: Remove short data This stage is same as that in ASR recipe. diff --git a/egs2/TEMPLATE/enh1/enh.sh b/egs2/TEMPLATE/enh1/enh.sh index fcb4f324f15..e0985ce67a7 100755 --- a/egs2/TEMPLATE/enh1/enh.sh +++ b/egs2/TEMPLATE/enh1/enh.sh @@ -201,6 +201,9 @@ fi [ -z "${valid_set}" ] && { log "${help_message}"; log "Error: --valid_set is required" ; exit 2; }; [ -z "${test_sets}" ] && { log "${help_message}"; log "Error: --test_sets is required"; exit 2; }; +# Extra files for enhancement process +utt_extra_files="utt2category" + data_feats=${dumpdir}/raw @@ -267,7 +270,7 @@ if ! "${skip_data_prep}"; then for factor in ${speed_perturb_factors}; do if [[ $(bc <<<"${factor} != 1.0") == 1 ]]; then - scripts/utils/perturb_enh_data_dir_speed.sh "${factor}" "data/${train_set}" "data/${train_set}_sp${factor}" "${_scp_list}" + scripts/utils/perturb_enh_data_dir_speed.sh --utt_extra_files "${utt_extra_files}" "${factor}" "data/${train_set}" "data/${train_set}_sp${factor}" "${_scp_list}" _dirs+="data/${train_set}_sp${factor} " else # If speed factor is 1, same as the original diff --git a/egs2/TEMPLATE/enh1/scripts/utils/perturb_enh_data_dir_speed.sh b/egs2/TEMPLATE/enh1/scripts/utils/perturb_enh_data_dir_speed.sh index 1d0a0fc3c3b..04887e10f30 100755 --- a/egs2/TEMPLATE/enh1/scripts/utils/perturb_enh_data_dir_speed.sh +++ b/egs2/TEMPLATE/enh1/scripts/utils/perturb_enh_data_dir_speed.sh @@ -27,6 +27,9 @@ export LC_ALL=C set -euo pipefail +utt_extra_files= +. utils/parse_options.sh + if [[ $# != 4 ]]; then echo "Usage: perturb_data_dir_speed.sh " echo "e.g.:" @@ -108,17 +111,15 @@ for scp_file in ${scp_files};do fi done -if [[ -f ${srcdir}/text ]]; then - utils/apply_map.pl -f 1 "${destdir}"/utt_map <"${srcdir}"/text >"${destdir}"/text -fi +for x in text utt2lang ${utt_extra_files}; do + if [[ -f ${srcdir}/${x} ]]; then + utils/apply_map.pl -f 1 "${destdir}"/utt_map <"${srcdir}"/${x} >"${destdir}"/${x} + fi +done if [[ -f ${srcdir}/spk2gender ]]; then utils/apply_map.pl -f 1 "${destdir}"/spk_map <"${srcdir}"/spk2gender >"${destdir}"/spk2gender fi -if [[ -f ${srcdir}/utt2lang ]]; then - utils/apply_map.pl -f 1 "${destdir}"/utt_map <"${srcdir}"/utt2lang >"${destdir}"/utt2lang -fi - rm "${destdir}"/spk_map "${destdir}"/utt_map "${destdir}"/reco_map 2>/dev/null echo "$0: generated speed-perturbed version of data in ${srcdir}, in ${destdir}" - +utils/fix_data_dir.sh "${destdir}" utils/validate_data_dir.sh --no-feats --no-text "${destdir}" diff --git a/egs2/TEMPLATE/enh_asr1/cmd.sh b/egs2/TEMPLATE/enh_asr1/cmd.sh new file mode 100644 index 00000000000..2aae6919fef --- /dev/null +++ b/egs2/TEMPLATE/enh_asr1/cmd.sh @@ -0,0 +1,110 @@ +# ====== About run.pl, queue.pl, slurm.pl, and ssh.pl ====== +# Usage: .pl [options] JOB=1: +# e.g. +# run.pl --mem 4G JOB=1:10 echo.JOB.log echo JOB +# +# Options: +# --time