Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'try to fix 'compute_fbank_kespeech_splits.py: error: unrecognized arguments: --speed-perturb true'' #1812

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,12 @@ def get_parser():
)

parser.add_argument(
"--whisper-fbank",
"--speed-perturb",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you only add new arguments but keep the existing ones?

type=str2bool,
default=False,
help="Use WhisperFbank instead of Fbank. Default: False.",
help="Enable 0.9 and 1.1 speed perturbation for data augmentation. Default: False.",
)

return parser


Expand Down Expand Up @@ -104,6 +105,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.",
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove above lines.


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
Loading