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.4.0.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.4.0-py3-none-any.whl (18.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fasr_vad_firered-0.4.0.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.4.0.tar.gz
Algorithm Hash digest
SHA256 c651057050f8e8d0ea235e51b4056b088ad883fb17c4e701b6ead25b976d8355
MD5 1cdf0fe72100b134d6fee06ad2a37a31
BLAKE2b-256 2119f2407b60bab60ad40bcf612fe8449a0c42df21606e3f988795cea818d85e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fasr_vad_firered-0.4.0-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.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 721db423550b98ff418cc6a7c3fb691264bf9423e18d79df40d19b4af2ee0db0
MD5 cb477fa88b4f37a22defb702545fc53f
BLAKE2b-256 7a7ff1fca659c159436d3b6b8499e4d92cfbeba536951b04e6c38973ff688e50

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