From 73e5caecc5194c04056ae3bd661f99e8ef488eff Mon Sep 17 00:00:00 2001 From: Yuekai Zhang Date: Fri, 23 Feb 2024 09:54:26 +0800 Subject: [PATCH] add speed perturb for kespeech --- egs/aishell4/ASR/prepare.sh | 8 ++++---- .../ASR/local/compute_fbank_alimeeting.py | 2 +- egs/alimeeting/ASR/prepare.sh | 10 ++++++---- egs/multi_zh-hans/ASR/prepare.sh | 20 ++++++------------- 4 files changed, 17 insertions(+), 23 deletions(-) diff --git a/egs/aishell4/ASR/prepare.sh b/egs/aishell4/ASR/prepare.sh index 945805a979..254ef08a43 100755 --- a/egs/aishell4/ASR/prepare.sh +++ b/egs/aishell4/ASR/prepare.sh @@ -78,9 +78,9 @@ fi if [ $stage -le 2 ] && [ $stop_stage -ge 2 ]; then log "Stage 2: Compute fbank for aishell4" if [ ! -f data/fbank/aishell4/.fbank.done ]; then - mkdir -p data/fbank/aishell4 + mkdir -p data/fbank ./local/compute_fbank_aishell4.py --perturb-speed ${perturb_speed} - touch data/fbank/aishell4/.fbank.done + touch data/fbank/.fbank.done fi fi @@ -88,9 +88,9 @@ whisper_mel_bins=80 if [ $stage -le 20 ] && [ $stop_stage -ge 20 ]; then log "Stage 20: Compute whisper fbank for aishell4" if [ ! -f data/fbank/aishell4/.fbank.done ]; then - mkdir -p data/fbank/aishell4 + mkdir -p data/fbank ./local/compute_fbank_aishell4.py --perturb-speed ${perturb_speed} --num-mel-bins ${whisper_mel_bins} --whisper-fbank true - touch data/fbank/aishell4/.fbank.done + touch data/fbank/.fbank.done fi fi diff --git a/egs/alimeeting/ASR/local/compute_fbank_alimeeting.py b/egs/alimeeting/ASR/local/compute_fbank_alimeeting.py index 32b4173a5a..b5cbadc1e2 100755 --- a/egs/alimeeting/ASR/local/compute_fbank_alimeeting.py +++ b/egs/alimeeting/ASR/local/compute_fbank_alimeeting.py @@ -53,7 +53,7 @@ def compute_fbank_alimeeting(num_mel_bins: int = 80, perturb_speed: bool = False "test", ) - prefix = "alimeeting" + prefix = "alimeeting-far" suffix = "jsonl.gz" manifests = read_manifests_if_cached( dataset_parts=dataset_parts, diff --git a/egs/alimeeting/ASR/prepare.sh b/egs/alimeeting/ASR/prepare.sh index 8b0366c97a..8580d9e2ac 100755 --- a/egs/alimeeting/ASR/prepare.sh +++ b/egs/alimeeting/ASR/prepare.sh @@ -67,18 +67,20 @@ fi if [ $stage -le 2 ] && [ $stop_stage -ge 2 ]; then log "Stage 2: compute fbank for alimeeting" - if [ ! -f data/fbank/alimeeting/.fbank.done ]; then - mkdir -p data/fbank/alimeeting + if [ ! -f data/fbank/.fbank.done ]; then + mkdir -p data/fbank ./local/compute_fbank_alimeeting.py --perturb-speed ${perturb_speed} + touch data/fbank/.fbank.done fi fi whisper_mel_bins=80 if [ $stage -le 20 ] && [ $stop_stage -ge 20 ]; then log "Stage 20: compute whisper fbank for alimeeting" - if [ ! -f data/fbank/alimeeting/.fbank.done ]; then - mkdir -p data/fbank/alimeeting + if [ ! -f data/fbank/.fbank.done ]; then + mkdir -p data/fbank ./local/compute_fbank_alimeeting.py --perturb-speed ${perturb_speed} --num-mel-bins ${whisper_mel_bins} --whisper-fbank true + touch data/fbank/.fbank.done fi fi diff --git a/egs/multi_zh-hans/ASR/prepare.sh b/egs/multi_zh-hans/ASR/prepare.sh index 9cab26a136..861b058887 100755 --- a/egs/multi_zh-hans/ASR/prepare.sh +++ b/egs/multi_zh-hans/ASR/prepare.sh @@ -5,8 +5,8 @@ export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python set -eou pipefail -stage=121 -stop_stage=121 +stage=120 +stop_stage=120 num_splits=100 dl_dir=$PWD/download @@ -86,7 +86,7 @@ fi log "Dataset: AISHELL-2" if [ $stage -le 4 ] && [ $stop_stage -ge 4 ]; then log "Stage 4: Prepare AISHELL-2" - if [ -e ../../aishell/ASR/data/fbank/.aishell2.done ]; then + if [ -e ../../aishell2/ASR/data/fbank/.aishell2.done ]; then cd data/fbank ln -svf $(realpath ../../../../aishell2/ASR/data/fbank/aishell2_feats_train) . ln -svf $(realpath ../../../../aishell2/ASR/data/fbank/aishell2_feats_dev) . @@ -104,7 +104,7 @@ fi log "Dataset: AISHELL-4" if [ $stage -le 5 ] && [ $stop_stage -ge 5 ]; then log "Stage 5: Prepare AISHELL-4" - if [ -e ../../aishell/ASR/data/fbank/.aishell4.done ]; then + if [ -e ../../aishell4/ASR/data/fbank/.fbank.done ]; then cd data/fbank ln -svf $(realpath ../../../../aishell4/ASR/data/fbank/aishell4_feats_train) . ln -svf $(realpath ../../../../aishell4/ASR/data/fbank/aishell4_feats_dev) . @@ -323,7 +323,7 @@ if [ $stage -le 120 ] && [ $stop_stage -ge 120 ]; then log "Preprocess KeSpeech manifest" if [ ! -f data/fbank/.kespeech_preprocess_complete ]; then - python3 ./local/preprocess_kespeech.py + python3 ./local/preprocess_kespeech.py --speed-perturb true touch data/fbank/.kespeech_preprocess_complete fi @@ -350,20 +350,12 @@ if [ $stage -le 120 ] && [ $stop_stage -ge 120 ]; then ./local/compute_fbank_kespeech_splits.py --speed-perturb true --num-splits ${num_splits} --training-subset train_phase2 --num-mel-bins ${whisper_mel_bins} --whisper-fbank true log "Compute KeSpeech fbank for test/dev" - ./local/compute_fbank_kespeech_dev_test.py --num-mel-bins ${whisper_mel_bins} --whisper-fbank true + # ./local/compute_fbank_kespeech_dev_test.py --num-mel-bins ${whisper_mel_bins} --whisper-fbank true touch data/fbank/.kespeech.done fi fi -if [ $stage -le 122 ] && [ $stop_stage -ge 122 ]; then - log "Stage 122: Prepare speed perturb versionKeSpeech for whisper" - ./local/compute_fbank_kespeech_splits.py --speed-perturb true --num-splits ${num_splits} --training-subset train_phase1 --num-mel-bins ${whisper_mel_bins} --whisper-fbank true - - log "Compute KeSpeech fbank for train_phase2" - ./local/compute_fbank_kespeech_splits.py --speed-perturb true --num-splits ${num_splits} --training-subset train_phase2 --num-mel-bins ${whisper_mel_bins} --whisper-fbank true -fi - if [ $stage -le 121 ] && [ $stop_stage -ge 121 ]; then log "Stage 121: Prepare MagicData, Primewords, ST-CMDS, THCHS-30 for whisper"