Export OnlineFeature and OfflineFeature.

This commit is contained in:
Fangjun Kuang 2022-04-08 16:42:16 +08:00
parent 1313e9dc61
commit 1efbb6dbf3
3 changed files with 13 additions and 0 deletions

View File

@ -5,6 +5,7 @@ exclude =
.git, .git,
build, build,
build_release, build_release,
cmake/cmake_extension.py,
kaldifeat/python/kaldifeat/__init__.py kaldifeat/python/kaldifeat/__init__.py
ignore = ignore =

View File

@ -10,5 +10,7 @@ from _kaldifeat import (
from .fbank import Fbank, OnlineFbank from .fbank import Fbank, OnlineFbank
from .mfcc import Mfcc, OnlineMfcc from .mfcc import Mfcc, OnlineMfcc
from .offline_feature import OfflineFeature
from .online_feature import OnlineFeature
from .plp import OnlinePlp, Plp from .plp import OnlinePlp, Plp
from .spectrogram import Spectrogram from .spectrogram import Spectrogram

View File

@ -91,5 +91,15 @@ class OnlineFeature(object):
""" """
self.computer.input_finished() self.computer.input_finished()
@property
def dim(self) -> int:
"""Return the feature dimension of this extractor"""
return self.computer.dim
@property
def frame_shift_in_seconds(self) -> int:
"""Return frame shift in seconds of this extractor"""
return self.computer.frame_shift_in_seconds
def __getstate__(self): def __getstate__(self):
return self.opts.as_dict() return self.opts.as_dict()