mirror of
https://github.com/k2-fsa/icefall.git
synced 2025-08-09 01:52:41 +00:00
Fix for asr_datamodule.py
This commit is contained in:
parent
85f6deb8d1
commit
eaaab47509
@ -29,7 +29,6 @@ from lhotse.dataset import ( # noqa F401 for PrecomputedFeatures
|
|||||||
CutConcatenate,
|
CutConcatenate,
|
||||||
CutMix,
|
CutMix,
|
||||||
DynamicBucketingSampler,
|
DynamicBucketingSampler,
|
||||||
K2SpeechRecognitionDataset,
|
|
||||||
PrecomputedFeatures,
|
PrecomputedFeatures,
|
||||||
SimpleCutSampler,
|
SimpleCutSampler,
|
||||||
SpecAugment,
|
SpecAugment,
|
||||||
@ -39,6 +38,7 @@ from lhotse.dataset.input_strategies import ( # noqa F401 For AudioSamples
|
|||||||
OnTheFlyFeatures,
|
OnTheFlyFeatures,
|
||||||
)
|
)
|
||||||
from lhotse.utils import fix_random_seed
|
from lhotse.utils import fix_random_seed
|
||||||
|
from speech_recognition import K2SpeechRecognitionDataset
|
||||||
from torch.utils.data import DataLoader
|
from torch.utils.data import DataLoader
|
||||||
|
|
||||||
from icefall.utils import str2bool
|
from icefall.utils import str2bool
|
||||||
@ -232,8 +232,11 @@ class LibriSpeechAsrDataModule:
|
|||||||
logging.info("Enable MUSAN")
|
logging.info("Enable MUSAN")
|
||||||
logging.info("About to get Musan cuts")
|
logging.info("About to get Musan cuts")
|
||||||
cuts_musan = load_manifest(self.args.manifest_dir / "musan_cuts.jsonl.gz")
|
cuts_musan = load_manifest(self.args.manifest_dir / "musan_cuts.jsonl.gz")
|
||||||
|
|
||||||
|
# We use probability 1.0 here so that musan augmentation is
|
||||||
|
# always performed
|
||||||
transforms.append(
|
transforms.append(
|
||||||
CutMix(cuts=cuts_musan, p=0.5, snr=(10, 20), preserve_id=True)
|
CutMix(cuts=cuts_musan, p=1.0, snr=(10, 20), preserve_id=True)
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
logging.info("Disable MUSAN")
|
logging.info("Disable MUSAN")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user