Skip to main content

NVIDIA MarbleNet vad model for fasr

Project description

fasr-vad-marblenet

英文文档地址: README_EN.md

NVIDIA MarbleNet 语音活动检测插件。插件内置 ONNX 模型,所以默认 marblenet 注册项无需额外下载权重即可使用。

安装

pip install fasr-vad-marblenet

注册模型

注册名 适用场景
marblenet MarbleNetForVAD CPU 友好的离线 ONNX VAD

流水线使用

from fasr import AudioPipeline

pipeline = (
    AudioPipeline()
    .add_pipe(
        "detector",
        model="marblenet",
        speaking_score=0.55,
        silence_score=0.45,
        fusion_threshold=0.2,
    )
    .add_pipe("recognizer", model="paraformer")
)
目标 写法 效果
减少噪声起点 speaking_score=0.65 需要更高置信度才开始语音
保留轻声 speaking_score=0.35 起点更敏感,但噪声风险更高
更快结束语音 silence_score=0.35 片段更短,尾部静音更少
减少碎片 fusion_threshold=0.3 合并短暂停顿隔开的片段
过滤点击声/短噪声 min_speech_duration=0.1 过滤短于 100ms 的片段
限制 ASR 片段长度 max_speech_duration=15.0 把长语音硬切成 15 秒片段

Confection 配置

[vad_model]
@vad_models = "marblenet"
speaking_score = 0.55
silence_score = 0.45
fusion_threshold = 0.2

放在流水线里:

[pipeline]
@pipelines = "AudioPipeline.v1"
pipe_order = ["detector"]

[pipeline.pipes]

[pipeline.pipes.detector]
@pipes = "thread_pipe"

[pipeline.pipes.detector.component]
@components = "detector"

[pipeline.pipes.detector.component.model]
@vad_models = "marblenet"
speaking_score = 0.55
silence_score = 0.45
fusion_threshold = 0.2

单独使用

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

model = registry.vad_models.get("marblenet")(
    speaking_score=0.55,
    silence_score=0.45,
)

audio = AudioSpan(waveform=Waveform.from_file("example.wav"), start_ms=0)
segments = model.detect(audio)

参数

参数 类型 / 范围 默认值 调高时 调低时 什么时候改
speaking_score float0.01.0 0.5 起点更严格 起点更敏感 起点误检或轻声漏检
silence_score float0.01.0 0.5 结束更晚 结束更早 片段太长或被截断
fusion_threshold float >= 0,秒 0.1 合并更宽的间隔 保留相邻片段分离 输出太碎或太粘
min_speech_duration float >= 0,秒 0.05 过滤更多短片段 保留更短片段 短噪声泄漏或短词消失
max_speech_duration float > 0None,秒 None 更长硬切上限 更短硬切上限 ASR 需要限制片段长度
intra_op_num_threads int >= 0 2 更多 CPU 并行 更少 CPU 占用 CPU 吞吐调优
inter_op_num_threads int >= 0 0 更多算子级并行 交给 ORT 决定 高级 ORT 调优

调参建议

现象 优先尝试
噪声触发语音起点 speaking_score=0.60.7
轻声开头漏掉 speaking_score=0.350.4
片段尾巴太长 silence_score=0.350.4
语音太早截断 silence_score=0.6
片段太碎 fusion_threshold=0.20.3
很短的误检片段多 min_speech_duration=0.1

依赖

  • fasr
  • numpy >= 1.24
  • onnxruntime >= 1.16.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_marblenet-0.5.8.tar.gz (1.1 MB view details)

Uploaded Source

Built Distribution

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

fasr_vad_marblenet-0.5.8-py3-none-any.whl (1.1 MB view details)

Uploaded Python 3

File details

Details for the file fasr_vad_marblenet-0.5.8.tar.gz.

File metadata

  • Download URL: fasr_vad_marblenet-0.5.8.tar.gz
  • Upload date:
  • Size: 1.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"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_marblenet-0.5.8.tar.gz
Algorithm Hash digest
SHA256 d0b7296365b881dbba6877fd19a4f703ddfa9c5212b37e71ea6627903219e103
MD5 9b8e0edd939cf0a2d8fbb442f02d27fe
BLAKE2b-256 f64e9651351fbfff0e4118ca55cbbeb99ee8a7d56b62dc4845e1f3bd50247bd4

See more details on using hashes here.

File details

Details for the file fasr_vad_marblenet-0.5.8-py3-none-any.whl.

File metadata

  • Download URL: fasr_vad_marblenet-0.5.8-py3-none-any.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"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_marblenet-0.5.8-py3-none-any.whl
Algorithm Hash digest
SHA256 78c8362129e0099448f332b82d93603d750b46f68936e2958babe99431074a03
MD5 d567d73e69ab435d38af947a775b0b17
BLAKE2b-256 dd7d51550cf92f8a5a3bb85ac7fb001aa39af84bdccbd783cfe618f664032689

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