fsmn vad
简介
核心亮点
- 精准切分语音片段,高效剔除背景静音
- 支持流式实时检测,低延迟响应速度快
- FunASR 生态原生支持,无缝衔接语音识别
- Apache-2.0 协议,商业化集成无压力
使用方法
# 安装 Hugging Face transformers
pip install transformers torch
# 使用 transformers 加载模型
from transformers import AutoModel, AutoTokenizer
model = AutoModel.from_pretrained("funasr/fsmn-vad")
tokenizer = AutoTokenizer.from_pretrained("funasr/fsmn-vad")
Hugging Face 下载
我们推荐使用命令行或者 Hugging Face Hub SDK 来进行模型的下载。
操作指引:在下载前,请先通过如下命令安装 huggingface_hub:
pip install -U huggingface_hub
命令行下载
下载完整模型库
huggingface-cli download funasr/fsmn-vad
下载单个文件到指定本地文件夹(以下载 config.json 到当前路径下 ./dir 目录为例)
huggingface-cli download funasr/fsmn-vad config.json --local-dir ./dir
SDK 下载
# 模型下载
from huggingface_hub import snapshot_download
model_dir = snapshot_download('funasr/fsmn-vad')
Git 下载
请确保 lfs 已经被正确安装
git lfs install
git clone https://huggingface.co/funasr/fsmn-vad
如果您希望跳过 lfs 大文件下载,可以使用如下命令
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/funasr/fsmn-vad
模型文件托管在 Hugging Face Hub,使用 HF CLI / SDK / Git 直接下载,不经过本站。
PyTorch / Transformers 使用
安装 Transformers
pip install -U transformers torch
模型加载和推理
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained('funasr/fsmn-vad')
tokenizer = AutoTokenizer.from_pretrained('funasr/fsmn-vad')
完整文档
---
license: apache-2.0
language:
- zh
- en
pipeline_tag: voice-activity-detection
tags:
- VAD
- FunASR
- voice-activity-detection
- speech-segmentation
library_name: funasr
---
<div align="center">
⭐ Powered by FunASR — please give us a GitHub Star!
This model is part of the FunASR ecosystem — one industrial-grade open-source toolkit for ASR · VAD · punctuation · speaker diarization · emotion / event · LLM-ASR. A Star really helps the project (and keeps you updated):
🌟 FunASR · 🌟 SenseVoice · 🌟 Fun-ASR · 🌟 FunClip
</div>
FSMN-VAD
Voice Activity Detection — accurately detect speech segments in audio, essential for long-audio processing pipelines.
FSMN-VAD uses a Feedforward Sequential Memory Network to detect speech/non-speech boundaries with high precision and low latency. It supports both streaming and offline modes.
Quick Start
from funasr import AutoModel
Standalone VAD
model = AutoModel(model="funasr/fsmn-vad", hub="hf", device="cuda")
result = model.generate(input="long_audio.wav")
Returns speech segments: [[start_ms, end_ms], [start_ms, end_ms], ...]
print(result[0]["value"])Use as Part of ASR Pipeline
from funasr import AutoModel
VAD automatically segments long audio before ASR
model = AutoModel(
model="funasr/paraformer-zh",
hub="hf",
vad_model="funasr/fsmn-vad",
device="cuda",
)
result = model.generate(input="meeting_2hours.wav")
print(result[0]["text"])Features
- Streaming and offline voice activity detection
- Configurable segment length (
max_single_segment_time)
- Low latency for real-time applications
- Works with all FunASR ASR models as a preprocessing step
Model Details
| Property | Value |
|----------|-------|
| Architecture | FSMN (Feedforward Sequential Memory Network) |
| Sample Rate | 16kHz |
| Modes | Streaming + Offline |
Links
- GitHub: FunASR