Skip to content

Commit

Permalink
minor updates
Browse files Browse the repository at this point in the history
  • Loading branch information
JinZr committed Jul 24, 2023
1 parent e85a935 commit 1e29c78
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 44 deletions.
11 changes: 4 additions & 7 deletions egs/aidatatang_200zh/ASR/local/compute_fbank_aidatatang_200zh.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,10 @@ def compute_fbank_aidatatang_200zh(num_mel_bins: int = 80, speed_perturb: bool =
recordings=m["recordings"],
supervisions=m["supervisions"],
)
if "train" in partition:
if speed_perturb:
cut_set = (
cut_set
+ cut_set.perturb_speed(0.9)
+ cut_set.perturb_speed(1.1)
)
if "train" in partition and speed_perturb:
cut_set = (
cut_set + cut_set.perturb_speed(0.9) + cut_set.perturb_speed(1.1)
)
cut_set = cut_set.compute_and_store_features(
extractor=extractor,
storage_path=f"{output_dir}/{prefix}_feats_{partition}",
Expand Down
11 changes: 4 additions & 7 deletions egs/aishell/ASR/local/compute_fbank_aishell.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,10 @@ def compute_fbank_aishell(num_mel_bins: int = 80, speed_perturb: bool = False):
recordings=m["recordings"],
supervisions=m["supervisions"],
)
if "train" in partition:
if speed_perturb:
cut_set = (
cut_set
+ cut_set.perturb_speed(0.9)
+ cut_set.perturb_speed(1.1)
)
if "train" in partition and speed_perturb:
cut_set = (
cut_set + cut_set.perturb_speed(0.9) + cut_set.perturb_speed(1.1)
)
cut_set = cut_set.compute_and_store_features(
extractor=extractor,
storage_path=f"{output_dir}/{prefix}_feats_{partition}",
Expand Down
11 changes: 4 additions & 7 deletions egs/aishell2/ASR/local/compute_fbank_aishell2.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,10 @@ def compute_fbank_aishell2(num_mel_bins: int = 80, speed_perturb: bool = False):
recordings=m["recordings"],
supervisions=m["supervisions"],
)
if "train" in partition:
if speed_perturb:
cut_set = (
cut_set
+ cut_set.perturb_speed(0.9)
+ cut_set.perturb_speed(1.1)
)
if "train" in partition and speed_perturb:
cut_set = (
cut_set + cut_set.perturb_speed(0.9) + cut_set.perturb_speed(1.1)
)
cut_set = cut_set.compute_and_store_features(
extractor=extractor,
storage_path=f"{output_dir}/{prefix}_feats_{partition}",
Expand Down
11 changes: 4 additions & 7 deletions egs/aishell4/ASR/local/compute_fbank_aishell4.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,10 @@ def compute_fbank_aishell4(num_mel_bins: int = 80, speed_perturb: bool = False):
recordings=m["recordings"],
supervisions=m["supervisions"],
)
if "train" in partition:
if speed_perturb:
cut_set = (
cut_set
+ cut_set.perturb_speed(0.9)
+ cut_set.perturb_speed(1.1)
)
if "train" in partition and speed_perturb:
cut_set = (
cut_set + cut_set.perturb_speed(0.9) + cut_set.perturb_speed(1.1)
)

cut_set = cut_set.compute_and_store_features(
extractor=extractor,
Expand Down
11 changes: 4 additions & 7 deletions egs/alimeeting/ASR/local/compute_fbank_alimeeting.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,10 @@ def compute_fbank_alimeeting(num_mel_bins: int = 80, speed_perturb: bool = False
recordings=m["recordings"],
supervisions=m["supervisions"],
)
if "train" in partition:
if speed_perturb:
cut_set = (
cut_set
+ cut_set.perturb_speed(0.9)
+ cut_set.perturb_speed(1.1)
)
if "train" in partition and speed_perturb:
cut_set = (
cut_set + cut_set.perturb_speed(0.9) + cut_set.perturb_speed(1.1)
)
cur_num_jobs = num_jobs if ex is None else 80
cur_num_jobs = min(cur_num_jobs, len(cut_set))

Expand Down
15 changes: 6 additions & 9 deletions egs/wenetspeech/ASR/local/preprocess_wenetspeech.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,12 @@ def preprocess_wenet_speech(speed_perturb: bool = False):
)
# Run data augmentation that needs to be done in the
# time domain.
if partition not in ["DEV", "TEST_NET", "TEST_MEETING"]:
if speed_perturb:
logging.info(
f"Speed perturb for {partition} with factors 0.9 and 1.1 "
"(Perturbing may take 8 minutes and saving may take 20 minutes)"
)
cut_set = (
cut_set + cut_set.perturb_speed(0.9) + cut_set.perturb_speed(1.1)
)
if partition not in ["DEV", "TEST_NET", "TEST_MEETING"] and speed_perturb:
logging.info(
f"Speed perturb for {partition} with factors 0.9 and 1.1 "
"(Perturbing may take 8 minutes and saving may take 20 minutes)"
)
cut_set = cut_set + cut_set.perturb_speed(0.9) + cut_set.perturb_speed(1.1)
logging.info(f"Saving to {raw_cuts_path}")
cut_set.to_file(raw_cuts_path)

Expand Down

0 comments on commit 1e29c78

Please sign in to comment.