diff --git a/.flake8 b/.flake8 index 19c3a9bd6..cfacdc5c9 100644 --- a/.flake8 +++ b/.flake8 @@ -6,6 +6,8 @@ per-file-ignores = # line too long egs/librispeech/ASR/*/conformer.py: E501, egs/aishell/ASR/*/conformer.py: E501, + egs/tedlium3/ASR/*/conformer.py: E501, + egs/tedlium3/ASR/local/display_manifest_statistics.py: E501, exclude = .git, diff --git a/egs/tedlium3/ASR/local/compute_fbank_tedlium.py b/egs/tedlium3/ASR/local/compute_fbank_tedlium.py index fb5c611f6..782fb5e92 100644 --- a/egs/tedlium3/ASR/local/compute_fbank_tedlium.py +++ b/egs/tedlium3/ASR/local/compute_fbank_tedlium.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3 -# Copyright 2021 Xiaomi Corp. (authors: Fangjun Kuang) +# Copyright 2021 Xiaomi Corp. (authors: Fangjun Kuang +# Mingshuang Luo) # # See ../../../../LICENSE for clarification regarding multiple authors # @@ -31,9 +32,10 @@ import torch from lhotse import CutSet, Fbank, FbankConfig, LilcomHdf5Writer from lhotse.recipes.utils import read_manifests_if_cached +from icefall.utils import get_executor + # from utils import read_manifests_if_cached -from icefall.utils import get_executor # Torch's multithreaded behavior needs to be disabled or # it wastes a lot of CPU and slow things down. @@ -71,7 +73,7 @@ def compute_fbank_tedlium(): cut_set = CutSet.from_manifests( recordings=m["recordings"], supervisions=m["supervisions"], - ) + ).trim_to_supervisions(keep_overlapping=False) if "train" in partition: cut_set = ( cut_set diff --git a/egs/tedlium3/ASR/local/display_manifest_statistics.py b/egs/tedlium3/ASR/local/display_manifest_statistics.py index 1573dbf7e..212e55d03 100644 --- a/egs/tedlium3/ASR/local/display_manifest_statistics.py +++ b/egs/tedlium3/ASR/local/display_manifest_statistics.py @@ -31,8 +31,9 @@ from lhotse import load_manifest def describe(cuts) -> None: """ - Print a message describing details about the ``CutSet`` - the number of cuts and the - duration statistics, including the total duration and the percentage of speech segments. + Print a message describing details about the ``CutSet`` - the number + of cuts and the duration statistics, including the total duration + and the percentage of speech segments. Example output: Cuts count: 804789 @@ -49,8 +50,6 @@ def describe(cuts) -> None: 99.5% 14.9 99.9% 16.6 max 33.3 - - In the above example, we set 15(>14.9) as the maximum duration of training samples. """ durations = np.array([c.duration for c in cuts]) speech_durations = np.array(