fsmn vad

提供商funasr
分类voice-activity-detection
许可证apache-2.0
下载量3.5K
星标0

简介

fsmn-vad 是由阿里 FunASR 团队开源的一款高性能语音端点检测模型。它主要用于从连续音频流中精准识别并切分出“有人说话”的片段,剔除静音和环境噪音。对于开发者而言,它是构建 ASR(语音识别)流水线不可或缺的前置环节,能有效降低后端识别模型的计算压力并提升识别准确率。该模型上手门槛低,支持流式处理,非常适合集成到实时语音助手、会议记录或长音频处理工具中,是目前工业界兼顾速度与精度的实用之选。

核心亮点

  • 精准切分语音片段,高效剔除背景静音
  • 支持流式实时检测,低延迟响应速度快
  • FunASR 生态原生支持,无缝衔接语音识别
  • Apache-2.0 协议,商业化集成无压力

使用方法

安装依赖
# 安装 Hugging Face transformers
pip install transformers torch
SDK 使用
# 使用 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 目录为例)

下载单个文件到指定本地文件夹(以下载 config.json 到当前路径下 ./dir 目录为例)
huggingface-cli download funasr/fsmn-vad config.json --local-dir ./dir

更多命令行下载选项,可参见官方文档

SDK 下载

SDK 下载
# 模型下载
from huggingface_hub import snapshot_download
model_dir = snapshot_download('funasr/fsmn-vad')

Git 下载

请确保 lfs 已经被正确安装

Git 下载
git lfs install
git clone https://huggingface.co/funasr/fsmn-vad

如果您希望跳过 lfs 大文件下载,可以使用如下命令

跳过 LFS
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/funasr/fsmn-vad

模型文件托管在 Hugging Face Hub,使用 HF CLI / SDK / Git 直接下载,不经过本站。

PyTorch / Transformers 使用

安装 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')

完整文档

来源: HuggingFace

---
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

python
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

python
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