Skip to main content

FireRedVAD for fasr (bundled fireredvad inference)

Project description

fasr-vad-firered

基于 FireRedVAD 的语音活动检测模型插件,为 fasr 提供非流式 VAD 能力。

安装

pip install fasr-vad-firered

注册模型

注册名 默认 checkpoint 说明
firered FireRedForVAD xukaituo/FireRedVAD 非流式 VAD,基于神经网络的语音段检测

模型权重默认从 ModelScope 自动下载。权重目录需包含 cmvn.arkmodel.pth.tar

使用方式

在流水线中使用

from fasr import AudioPipeline

pipeline = (
    AudioPipeline()
    .add_pipe("detector", model="firered")
    .add_pipe("recognizer", model="firered_aed", checkpoint_dir="/path/to/asr-ckpt")
    .add_pipe("sentencizer", model="ct_transformer")
)

单独使用模型

from fasr.config import registry
from fasr.data import Waveform

model = registry.vad_models.get("firered")()
model.from_checkpoint(use_gpu=True, speech_threshold=0.4)

waveform = Waveform.from_file("example.wav")
segments = model.detect(waveform)
for seg in segments:
    print(f"{seg.start_ms}ms - {seg.end_ms}ms")

from_checkpoint 参数

参数 类型 默认值 说明
checkpoint_dir str | Path | None None(自动下载) 模型权重目录,需含 cmvn.arkmodel.pth.tar
use_gpu bool False 是否使用 GPU 推理
speech_threshold float 0.4 语音判定阈值,越小越敏感

依赖

  • fasr
  • torch >= 2.0.0
  • soundfile >= 0.12.0
  • kaldiio >= 2.18.0kaldi-native-fbank >= 1.19.0
  • Python 3.10–3.12

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fasr_vad_firered-0.3.9.tar.gz (14.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fasr_vad_firered-0.3.9-py3-none-any.whl (18.8 kB view details)

Uploaded Python 3

File details

Details for the file fasr_vad_firered-0.3.9.tar.gz.

File metadata

  • Download URL: fasr_vad_firered-0.3.9.tar.gz
  • Upload date:
  • Size: 14.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for fasr_vad_firered-0.3.9.tar.gz
Algorithm Hash digest
SHA256 99498a1d0a08912a280af4981508eea7d927f8cb04a9a44dfa201a12e24368c3
MD5 46a5a19af9cfda0cdcdd63ba40700cce
BLAKE2b-256 e2292814a02384042458e55ef1d3605f96795b2322495dcd479a4efee8d5d468

See more details on using hashes here.

File details

Details for the file fasr_vad_firered-0.3.9-py3-none-any.whl.

File metadata

  • Download URL: fasr_vad_firered-0.3.9-py3-none-any.whl
  • Upload date:
  • Size: 18.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for fasr_vad_firered-0.3.9-py3-none-any.whl
Algorithm Hash digest
SHA256 6a7152ec63dac4fdbbe448a7dc4491f15135f99bd326c41523f34d35804fa26d
MD5 2db1a98558814ff87bb57b039dc604fc
BLAKE2b-256 9dbb5f8cfc633800d286f25ebb979f470e4e2d3e1b58e304849df3ca794284c6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page