mirror of
https://github.com/k2-fsa/icefall.git
synced 2025-08-09 01:52:41 +00:00
'try to fix 'compute_fbank_kespeech_splits.py: error: unrecognized arguments: --speed-perturb true'' (#1812)
This commit is contained in:
parent
1c4dd464a0
commit
5c04f7bfb8
@ -52,13 +52,19 @@ def get_parser():
|
|||||||
default=80,
|
default=80,
|
||||||
help="""The number of mel bins for Fbank""",
|
help="""The number of mel bins for Fbank""",
|
||||||
)
|
)
|
||||||
|
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--whisper-fbank",
|
"--whisper-fbank",
|
||||||
type=str2bool,
|
type=str2bool,
|
||||||
default=False,
|
default=False,
|
||||||
help="Use WhisperFbank instead of Fbank. 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
|
return parser
|
||||||
|
|
||||||
|
|
||||||
@ -104,6 +110,10 @@ def compute_fbank_kespeech_dev_test(args):
|
|||||||
keep_overlapping=False, min_duration=None
|
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")
|
logging.info("Computing features")
|
||||||
cut_set = cut_set.compute_and_store_features_batch(
|
cut_set = cut_set.compute_and_store_features_batch(
|
||||||
extractor=extractor,
|
extractor=extractor,
|
||||||
|
@ -106,6 +106,14 @@ def get_parser():
|
|||||||
default=False,
|
default=False,
|
||||||
help="Use WhisperFbank instead of Fbank. 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
|
return parser
|
||||||
|
|
||||||
|
|
||||||
@ -158,6 +166,11 @@ def compute_fbank_kespeech_splits(args):
|
|||||||
keep_overlapping=False, min_duration=None
|
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")
|
logging.info("Computing features")
|
||||||
cut_set = cut_set.compute_and_store_features_batch(
|
cut_set = cut_set.compute_and_store_features_batch(
|
||||||
extractor=extractor,
|
extractor=extractor,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user