From 594b79f59e7eefa6955c729f6264c8c99d1d9571 Mon Sep 17 00:00:00 2001
From: hnluo <haoneng.lhn@alibaba-inc.com>
Date: 星期一, 05 六月 2023 16:46:15 +0800
Subject: [PATCH] Merge pull request #591 from alibaba-damo-academy/dev_lhn
---
funasr/models/frontend/default.py | 8 +++-----
1 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/funasr/models/frontend/default.py b/funasr/models/frontend/default.py
index 2e1b0c4..19994f0 100644
--- a/funasr/models/frontend/default.py
+++ b/funasr/models/frontend/default.py
@@ -18,7 +18,6 @@
class DefaultFrontend(AbsFrontend):
"""Conventional frontend structure for ASR.
-
Stft -> WPE -> MVDR-Beamformer -> Power-spec -> Mel-Fbank -> CMVN
"""
@@ -102,8 +101,8 @@
if input_stft.dim() == 4:
# h: (B, T, C, F) -> h: (B, T, F)
if self.training:
- if self.use_channel == None:
- input_stft = input_stft[:, :, 0, :]
+ if self.use_channel is not None:
+ input_stft = input_stft[:, :, self.use_channel, :]
else:
# Select 1ch randomly
ch = np.random.randint(input_stft.size(2))
@@ -142,7 +141,6 @@
class MultiChannelFrontend(AbsFrontend):
"""Conventional frontend structure for ASR.
-
Stft -> WPE -> MVDR-Beamformer -> Power-spec -> Mel-Fbank -> CMVN
"""
@@ -260,4 +258,4 @@
# Change torch.Tensor to ComplexTensor
# input_stft: (..., F, 2) -> (..., F)
input_stft = ComplexTensor(input_stft[..., 0], input_stft[..., 1])
- return input_stft, feats_lens
+ return input_stft, feats_lens
\ No newline at end of file
--
Gitblit v1.9.1