Skip to content

Commit

Permalink
'try to fix 'compute_fbank_kespeech_splits.py: error: unrecognized ar…
Browse files Browse the repository at this point in the history
…guments: --speed-perturb true'' (#1812)
  • Loading branch information
goddamnVincent authored Dec 8, 2024
1 parent 1c4dd46 commit 5c04f7b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
12 changes: 11 additions & 1 deletion egs/multi_zh-hans/ASR/local/compute_fbank_kespeech_dev_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,19 @@ def get_parser():
default=80,
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.",
)
parser.add_argument(
"--speed-perturb",
type=str2bool,
default=False,
help="Enable 0.9 and 1.1 speed perturbation for data augmentation. Default: False.",
)

return parser


Expand Down Expand Up @@ -104,6 +110,10 @@ def compute_fbank_kespeech_dev_test(args):
keep_overlapping=False, min_duration=None
)

if args.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,
Expand Down
13 changes: 13 additions & 0 deletions egs/multi_zh-hans/ASR/local/compute_fbank_kespeech_splits.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,14 @@ def get_parser():
default=False,
help="Use WhisperFbank instead of Fbank. Default: False.",
)

parser.add_argument(
"--speed-perturb",
type=str2bool,
default=False,
help="Enable 0.9 and 1.1 speed perturbation for data augmentation. Default: False.",
)

return parser


Expand Down Expand Up @@ -158,6 +166,11 @@ def compute_fbank_kespeech_splits(args):
keep_overlapping=False, min_duration=None
)

if args.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,
Expand Down

0 comments on commit 5c04f7b

Please sign in to comment.