From 51efa14f3313d8f6362b037ffe8432a88dc9c25b Mon Sep 17 00:00:00 2001 From: goddamnVincent <1262780247@qq.com> Date: Wed, 27 Nov 2024 12:57:29 +0800 Subject: [PATCH] 'update' --- .idea/.gitignore | 3 +++ .idea/icefall.iml | 15 +++++++++++++++ .idea/inspectionProfiles/Project_Default.xml | 6 ++++++ .idea/inspectionProfiles/profiles_settings.xml | 6 ++++++ .idea/modules.xml | 8 ++++++++ .idea/vcs.xml | 6 ++++++ .../local/compute_fbank_kespeech_dev_test.py | 14 ++++++++++++-- .../ASR/local/compute_fbank_kespeech_splits.py | 18 ++++++++++++++++++ 8 files changed, 74 insertions(+), 2 deletions(-) create mode 100644 .idea/.gitignore create mode 100644 .idea/icefall.iml create mode 100644 .idea/inspectionProfiles/Project_Default.xml create mode 100644 .idea/inspectionProfiles/profiles_settings.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 000000000..26d33521a --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/icefall.iml b/.idea/icefall.iml new file mode 100644 index 000000000..5fdd65ba2 --- /dev/null +++ b/.idea/icefall.iml @@ -0,0 +1,15 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 000000000..cd8384564 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 000000000..105ce2da2 --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 000000000..b33405972 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 000000000..35eb1ddfb --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/egs/multi_zh-hans/ASR/local/compute_fbank_kespeech_dev_test.py b/egs/multi_zh-hans/ASR/local/compute_fbank_kespeech_dev_test.py index 6f75dbfa4..52be85072 100755 --- a/egs/multi_zh-hans/ASR/local/compute_fbank_kespeech_dev_test.py +++ b/egs/multi_zh-hans/ASR/local/compute_fbank_kespeech_dev_test.py @@ -52,7 +52,13 @@ def get_parser(): default=80, help="""The number of mel bins for Fbank""", ) - + # 修改: 添加 指定参数 speed-perturb + parser.add_argument( + "--speed-perturb", + type=bool, + default=False, + help="Enable 0.9 and 1.1 speed perturbation for data augmentation. Default: False.", + ) parser.add_argument( "--whisper-fbank", type=str2bool, @@ -103,7 +109,11 @@ def compute_fbank_kespeech_dev_test(args): cut_set = cut_set.trim_to_supervisions( keep_overlapping=False, min_duration=None ) - + # 修改 执行 perturb操作 + if speed_perturb: + cut_set = ( + cut_set + cut_set.perturb_speed(0.9) + cut_set.perturb_speed(1.1) + ) logging.info("Computing features") cut_set = cut_set.compute_and_store_features_batch( extractor=extractor, diff --git a/egs/multi_zh-hans/ASR/local/compute_fbank_kespeech_splits.py b/egs/multi_zh-hans/ASR/local/compute_fbank_kespeech_splits.py index c398411f6..1bbe68de7 100755 --- a/egs/multi_zh-hans/ASR/local/compute_fbank_kespeech_splits.py +++ b/egs/multi_zh-hans/ASR/local/compute_fbank_kespeech_splits.py @@ -100,6 +100,19 @@ def get_parser(): help="""The number of mel bins for Fbank""", ) + parser.add_argument( + "--whisper-fbank", + type=str2bool, + default=False, + help="Use WhisperFbank instead of Fbank. Default: False.", + ) + #修改: 添加 指定参数 speed-perturb + parser.add_argument( + "--speed-perturb", + type=bool, + default=False, + help="Enable 0.9 and 1.1 speed perturbation for data augmentation. Default: False.", + ) parser.add_argument( "--whisper-fbank", type=str2bool, @@ -157,6 +170,11 @@ def compute_fbank_kespeech_splits(args): cut_set = cut_set.trim_to_supervisions( keep_overlapping=False, min_duration=None ) + # 修改 执行 perturb操作 + if speed_perturb: + cut_set = ( + cut_set + cut_set.perturb_speed(0.9) + cut_set.perturb_speed(1.1) + ) logging.info("Computing features") cut_set = cut_set.compute_and_store_features_batch(