| | |
| | | from typing import Tuple |
| | | from typing import Union |
| | | import logging |
| | | import humanfriendly |
| | | import numpy as np |
| | | import torch |
| | | import torch.nn as nn |
| | |
| | | from funasr.frontends.utils.stft import Stft |
| | | from funasr.frontends.utils.frontend import Frontend |
| | | from funasr.models.transformer.utils.nets_utils import make_pad_mask |
| | | from funasr.register import tables |
| | | |
| | | |
| | | @tables.register("frontend_classes", "DefaultFrontend") |
| | | class DefaultFrontend(nn.Module): |
| | | """Conventional frontend structure for ASR. |
| | | Stft -> WPE -> MVDR-Beamformer -> Power-spec -> Mel-Fbank -> CMVN |
| | |
| | | frontend_conf: Optional[dict] = None, |
| | | apply_stft: bool = True, |
| | | use_channel: int = None, |
| | | **kwargs, |
| | | ): |
| | | super().__init__() |
| | | if isinstance(fs, str): |