FireRedTeam commited on
Commit
b84d013
·
verified ·
1 Parent(s): d874709

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +49 -330
README.md CHANGED
@@ -4,6 +4,7 @@ language:
4
  - en
5
  - zh
6
  tags:
 
7
  - Voice Acticity Detection
8
  - voice activity detection
9
  - speech activity detection
@@ -18,109 +19,38 @@ tags:
18
  - asr
19
  ---
20
 
 
21
  <div align="center">
22
  <h1>
23
- FireRedASR2S
24
  <br>
25
- A SOTA Industrial-Grade All-in-One ASR System
26
  </h1>
27
 
28
  </div>
29
 
30
- [[Paper]](https://arxiv.org/pdf/2501.14350)
31
- [[Model]](https://huggingface.co/FireRedTeam)
32
- [[Blog]](https://fireredteam.github.io/demos/firered_asr/)
33
- [[Demo]](https://huggingface.co/spaces/FireRedTeam/FireRedASR)
34
 
35
 
36
- FireRedASR2S is a state-of-the-art (SOTA), industrial-grade, all-in-one ASR system with ASR, VAD, LID, and Punc modules. All modules achieve SOTA performance:
37
- - **FireRedASR2**: Automatic Speech Recognition (ASR) supporting Chinese (Mandarin, 20+ dialects/accents), English, code-switching, and singing lyrics recognition. 2.89% average CER on Mandarin (4 test sets), 11.55% on Chinese dialects (19 test sets), outperforming Doubao-ASR, Qwen3-ASR-1.7B, Fun-ASR, and Fun-ASR-Nano-2512. FireRedASR2-AED also supports word-level timestamps and confidence scores.
38
- - **FireRedVAD**: Voice Activity Detection (VAD) supporting speech/singing/music in 100+ languages. 97.57% F1, outperforming Silero-VAD, TEN-VAD, and FunASR-VAD. Supports non-streaming/streaming VAD and Audio Event Detection.
39
- - **FireRedLID**: Spoken Language Identification (LID) supporting 100+ languages and 20+ Chinese dialects/accents. 97.18% accuracy, outperforming Whisper and SpeechBrain-LID.
40
- - **FireRedPunc**: Punctuation Prediction (Punc) for Chinese and English. 78.90% average F1, outperforming FunASR-Punc (62.77%).
41
 
42
- *`2S`: `2`nd-generation FireRedASR, now expanded to an all-in-one ASR `S`ystem*
43
 
44
 
45
  ## 🔥 News
46
- - [2026.02.12] We release FireRedASR2S (FireRedASR2-AED, FireRedVAD, FireRedLID, and FireRedPunc) with model weights and inference code. Download links below. Technical report and finetuning code coming soon.
47
-
48
-
49
-
50
- ## Available Models and Languages
51
-
52
- |Model|Supported Languages & Dialects|Download|
53
- |:-------------:|:---------------------------------:|:----------:|
54
- |FireRedASR2| Chinese (Mandarin and 20+ dialects/accents<sup>*</sup>), English, Code-Switching | [🤗](https://huggingface.co/FireRedTeam/FireRedASR2-AED) \| [🤖](https://modelscope.cn/collections/FireRedTeam/FireRedASR2S)|
55
- |FireRedVAD | 100+ languages, 20+ Chinese dialects/accents<sup>*</sup> | [🤗](https://huggingface.co/FireRedTeam/FireRedVAD) \| [🤖](https://modelscope.cn/collections/FireRedTeam/FireRedVAD)|
56
- |FireRedLID | 100+ languages, 20+ Chinese dialects/accents<sup>*</sup> | [🤗](https://huggingface.co/FireRedTeam/FireRedLID) \| [🤖](https://modelscope.cn/collections/FireRedTeam/FireRedLID)|
57
- |FireRedPunc| Chinese, English | [🤗](https://huggingface.co/FireRedTeam/FireRedPunc) \| [🤖](https://modelscope.cn/collections/FireRedTeam/FireRedPunc)|
58
-
59
- <sup>*</sup>Supported Chinese dialects/accents: Cantonese (Hong Kong & Guangdong), Sichuan, Shanghai, Wu, Minnan, Anhui, Fujian, Gansu, Guizhou, Hebei, Henan, Hubei, Hunan, Jiangxi, Liaoning, Ningxia, Shaanxi, Shanxi, Shandong, Tianjin, Yunnan, etc.
60
 
61
 
62
 
63
  ## Method
64
- ### FireRedASR2
65
- FireRedASR2 builds upon [FireRedASR](https://github.com/FireRedTeam/FireRedASR) with improved accuracy, designed to meet diverse requirements in superior performance and optimal efficiency across various applications. It comprises two variants:
66
- - **FireRedASR2-LLM**: Designed to achieve state-of-the-art performance and to enable seamless end-to-end speech interaction. It adopts an Encoder-Adapter-LLM framework leveraging large language model (LLM) capabilities.
67
- - **FireRedASR2-AED**: Designed to balance high performance and computational efficiency and to serve as an effective speech representation module in LLM-based speech models. It utilizes an Attention-based Encoder-Decoder (AED) architecture.
68
 
69
 
70
- ### Other Modules
71
- - **FireRedVAD**: DFSMN-based non-streaming/streaming Voice Activity Detection and Audio Event Detection.
72
- - **FireRedLID**: FireRedASR2-based Spoken Language Identification. See [FireRedLID README](./fireredasr2s/fireredlid/README.md) for language details.
73
- - **FireRedPunc**: BERT-based Punctuation Prediction.
74
-
75
 
76
  ## Evaluation
77
- ### FireRedASR2
78
- Metrics: Character Error Rate (CER%) for Chinese and Word Error Rate (WER%) for English. Lower is better.
79
-
80
- We evaluate FireRedASR2 on 24 public test sets covering Mandarin, 20+ Chinese dialects/accents, and singing.
81
-
82
- - **Mandarin (4 test sets)**: 2.89% (LLM) / 3.05% (AED) average CER, outperforming Doubao-ASR (3.69%), Qwen3-ASR-1.7B (3.76%), Fun-ASR (4.16%) and Fun-ASR-Nano-2512 (4.55%).
83
- - **Dialects (19 test sets)**: 11.55% (LLM) / 11.67% (AED) average CER, outperforming Doubao-ASR (15.39%), Qwen3-ASR-1.7B (11.85%), Fun-ASR (12.76%) and Fun-ASR-Nano-2512 (15.07%).
84
-
85
- *Note: ws=WenetSpeech, md=MagicData, conv=Conversational, daily=Daily-use.*
86
-
87
- |ID|Testset\Model|FireRedASR2-LLM|FireRedASR2-AED|Doubao-ASR|Qwen3-ASR|Fun-ASR|Fun-ASR-Nano|
88
- |:--:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|
89
- | |**Average CER<br>(All, 1-24)** |**9.67** |**9.80** |12.98 |10.12 |10.92 |12.81 |
90
- | |**Average CER<br>(Mandarin, 1-4)** |**2.89** |**3.05** |3.69 |3.76 |4.16 |4.55 |
91
- | |**Average CER<br>(Dialects, 5-23)** |**11.55**|**11.67**|15.39|11.85|12.76|15.07|
92
- |1 |aishell1 |0.64 |0.57 |1.52 |1.48 |1.64 |1.96 |
93
- |2 |aishell2 |2.15 |2.51 |2.77 |2.71 |2.38 |3.02 |
94
- |3 |ws-net |4.44 |4.57 |5.73 |4.97 |6.85 |6.93 |
95
- |4 |ws-meeting |4.32 |4.53 |4.74 |5.88 |5.78 |6.29 |
96
- |5 |kespeech |3.08 |3.60 |5.38 |5.10 |5.36 |7.66 |
97
- |6 |ws-yue-short |5.14 |5.15 |10.51|5.82 |7.34 |8.82 |
98
- |7 |ws-yue-long |8.71 |8.54 |11.39|8.85 |10.14|11.36|
99
- |8 |ws-chuan-easy |10.90|10.60|11.33|11.99|12.46|14.05|
100
- |9 |ws-chuan-hard |20.71|21.35|20.77|21.63|22.49|25.32|
101
- |10|md-heavy |7.42 |7.43 |7.69 |8.02 |9.13 |9.97 |
102
- |11|md-yue-conv |12.23|11.66|26.25|9.76 |33.71|15.68|
103
- |12|md-yue-daily |3.61 |3.35 |12.82|3.66 |2.69 |5.67 |
104
- |13|md-yue-vehicle |4.50 |4.83 |8.66 |4.28 |6.00 |7.04 |
105
- |14|md-chuan-conv |13.18|13.07|11.77|14.35|14.01|17.11|
106
- |15|md-chuan-daily |4.90 |5.17 |3.90 |4.93 |3.98 |5.95 |
107
- |16|md-shanghai-conv |28.70|27.02|45.15|29.77|25.49|37.08|
108
- |17|md-shanghai-daily |24.94|24.18|44.06|23.93|12.55|28.77|
109
- |18|md-wu |7.15 |7.14 |7.70 |7.57 |10.63|10.56|
110
- |19|md-zhengzhou-conv |10.20|10.65|9.83 |9.55 |10.85|13.09|
111
- |20|md-zhengzhou-daily|5.80 |6.26 |5.77 |5.88 |6.29 |8.18 |
112
- |21|md-wuhan |9.60 |10.81|9.94 |10.22|4.34 |8.70 |
113
- |22|md-tianjin |15.45|15.30|15.79|16.16|19.27|22.03|
114
- |23|md-changsha |23.18|25.64|23.76|23.70|25.66|29.23|
115
- |24|opencpop |1.12 |1.17 |4.36 |2.57 |3.05 |2.95 |
116
-
117
- Doubao-ASR (volc.seedasr.auc) tested in early February 2026, and Fun-ASR tested in late November 2025. Our ASR training data does not include any Chinese dialect or accented speech data from MagicData.
118
- - Doubao-ASR (API): https://www.volcengine.com/docs/6561/1354868
119
- - Qwen3-ASR (1.7B): https://github.com/QwenLM/Qwen3-ASR
120
- - Fun-ASR (API): https://help.aliyun.com/zh/model-studio/recording-file-recognition
121
- - Fun-ASR-Nano-2512: https://huggingface.co/FunAudioLLM/Fun-ASR-Nano-2512
122
-
123
-
124
  ### FireRedVAD
125
  We evaluate FireRedVAD on FLEURS-VAD-102, a multilingual VAD benchmark covering 102 languages.
126
 
@@ -138,50 +68,21 @@ FireRedVAD achieves SOTA performance, outperforming Silero-VAD, TEN-VAD, FunASR-
138
  Note: FunASR-VAD achieves low Miss Rate but at the cost of high False Alarm Rate (44.03%), indicating over-prediction of speech segments.
139
 
140
 
141
- ### FireRedLID
142
- Metric: Utterance-level LID Accuracy (%). Higher is better.
143
-
144
- We evaluate FireRedLID on multilingual and Chinese dialect benchmarks.
145
-
146
- FireRedLID achieves SOTA performance, outperforming Whisper, SpeechBrain-LID, and Dolphin.
147
-
148
- |Testset\Model|Languages|FireRedLID|[Whisper](https://github.com/openai/whisper)|[SpeechBrain](https://huggingface.co/speechbrain/lang-id-voxlingua107-ecapa)|[Dolphin](https://github.com/DataoceanAI/Dolphin)|
149
- |:-----------------:|:---------:|:---------:|:-----:|:---------:|:-----:|
150
- |FLEURS test |82 languages |**97.18** |79.41 |92.91 |-|
151
- |CommonVoice test |74 languages |**92.07** |80.81 |78.75 |-|
152
- |KeSpeech + MagicData|20+ Chinese dialects/accents |**88.47** |-|-|69.01|
153
-
154
-
155
- ### FireRedPunc
156
- Metric: Precision/Recall/F1 Score (%). Higher is better.
157
-
158
- We evaluate FireRedPunc on multi-domain Chinese and English benchmarks.
159
-
160
- FireRedPunc achieves SOTA performance, outperforming FunASR-Punc (CT-Transformer).
161
-
162
- |Testset\Model|#Sentences|FireRedPunc|[FunASR-Punc](https://www.modelscope.cn/models/iic/punc_ct-transformer_zh-cn-common-vocab272727-pytorch)|
163
- |:------------------:|:---------:|:--------------:|:-----------------:|
164
- |Multi-domain Chinese| 88,644 |**82.84 / 83.08 / 82.96** | 77.27 / 74.03 / 75.62 |
165
- |Multi-domain English| 28,641 |**78.40 / 71.57 / 74.83** | 55.79 / 45.15 / 49.91 |
166
- |Average F1 Score | - |**78.90** | 62.77 |
167
-
168
-
169
-
170
 
171
  ## Quick Start
172
  ### Setup
173
  1. Create a clean Python environment:
174
  ```bash
175
- $ conda create --name fireredasr2s python=3.10
176
- $ conda activate fireredasr2s
177
- $ git clone https://github.com/FireRedTeam/FireRedASR2S.git
178
- $ cd FireRedASR2S # or fireredasr2s
179
  ```
180
 
181
  2. Install dependencies and set up PATH and PYTHONPATH:
182
  ```bash
183
  $ pip install -r requirements.txt
184
- $ export PATH=$PWD/fireredasr2s/:$PATH
185
  $ export PYTHONPATH=$PWD/:$PYTHONPATH
186
  ```
187
 
@@ -189,17 +90,11 @@ $ export PYTHONPATH=$PWD/:$PYTHONPATH
189
  ```bash
190
  # Download via ModelScope (recommended for users in China)
191
  pip install -U modelscope
192
- modelscope download --model FireRedTeam/FireRedASR2-AED --local_dir ./pretrained_models/FireRedASR2-AED
193
- modelscope download --model FireRedTeam/FireRedVAD --local_dir ./pretrained_models/FireRedVAD
194
- modelscope download --model FireRedTeam/FireRedLID --local_dir ./pretrained_models/FireRedLID
195
- modelscope download --model FireRedTeam/FireRedPunc --local_dir ./pretrained_models/FireRedPunc
196
 
197
  # Download via Hugging Face
198
  pip install -U "huggingface_hub[cli]"
199
- huggingface-cli download FireRedTeam/FireRedASR2-AED --local-dir ./pretrained_models/FireRedASR2-AED
200
  huggingface-cli download FireRedTeam/FireRedVAD --local-dir ./pretrained_models/FireRedVAD
201
- huggingface-cli download FireRedTeam/FireRedLID --local-dir ./pretrained_models/FireRedLID
202
- huggingface-cli download FireRedTeam/FireRedPunc --local-dir ./pretrained_models/FireRedPunc
203
  ```
204
 
205
  4. Convert your audio to **16kHz 16-bit mono PCM** format if needed:
@@ -209,108 +104,43 @@ $ ffmpeg -i <input_audio_path> -ar 16000 -ac 1 -acodec pcm_s16le -f wav <output_
209
 
210
  ### Script Usage
211
  ```bash
212
- $ cd examples_infer/asr_system
213
- $ bash inference_asr_system.sh
214
- ```
215
-
216
- ### Command-line Usage
217
- ```bash
218
- $ fireredasr2s-cli --help
219
- $ fireredasr2s-cli --wav_paths "assets/hello_zh.wav" "assets/hello_en.wav" --outdir output
220
- $ cat output/result.jsonl
221
- # {"uttid": "hello_zh", "text": "你好世界。", "sentences": [{"start_ms": 310, "end_ms": 1840, "text": "你好世界。", "asr_confidence": 0.875, "lang": "zh mandarin", "lang_confidence": 0.999}], "vad_segments_ms": [[310, 1840]], "dur_s": 2.32, "words": [{"start_ms": 490, "end_ms": 690, "text": "你"}, {"start_ms": 690, "end_ms": 1090, "text": "好"}, {"start_ms": 1090, "end_ms": 1330, "text": "世"}, {"start_ms": 1330, "end_ms": 1795, "text": "界"}], "wav_path": "assets/hello_zh.wav"}
222
- # {"uttid": "hello_en", "text": "Hello speech.", "sentences": [{"start_ms": 120, "end_ms": 1840, "text": "Hello speech.", "asr_confidence": 0.833, "lang": "en", "lang_confidence": 0.998}], "vad_segments_ms": [[120, 1840]], "dur_s": 2.24, "words": [{"start_ms": 340, "end_ms": 1020, "text": "hello"}, {"start_ms": 1020, "end_ms": 1666, "text": "speech"}], "wav_path": "assets/hello_en.wav"}
223
- ```
224
-
225
- ### Python API Usage
226
- ```python
227
- from fireredasr2s import FireRedAsr2System, FireRedAsr2SystemConfig
228
-
229
- asr_system_config = FireRedAsr2SystemConfig() # Use default config
230
- asr_system = FireRedAsr2System(asr_system_config)
231
-
232
- result = asr_system.process("assets/hello_zh.wav")
233
- print(result)
234
- # {'uttid': 'tmpid', 'text': '你好世界。', 'sentences': [{'start_ms': 440, 'end_ms': 1820, 'text': '你好世界。', 'asr_confidence': 0.868, 'lang': 'zh mandarin', 'lang_confidence': 0.999}], 'vad_segments_ms': [(440, 1820)], 'dur_s': 2.32, 'words': [], 'wav_path': 'assets/hello_zh.wav'}
235
-
236
- result = asr_system.process("assets/hello_en.wav")
237
- print(result)
238
- # {'uttid': 'tmpid', 'text': 'Hello speech.', 'sentences': [{'start_ms': 260, 'end_ms': 1820, 'text': 'Hello speech.', 'asr_confidence': 0.933, 'lang': 'en', 'lang_confidence': 0.993}], 'vad_segments_ms': [(260, 1820)], 'dur_s': 2.24, 'words': [], 'wav_path': 'assets/hello_en.wav'}
239
  ```
240
 
241
 
 
 
242
 
243
- ## Usage of Each Module
244
- The four components under `fireredasr2s`, i.e. `fireredasr2`, `fireredvad`, `fireredlid`, and `fireredpunc` are self-contained and designed to work as a standalone modules. You can use any of them independently without depending on the others. `FireRedVAD` and `FireRedLID` will also be open-sourced as standalone libraries in separate repositories.
245
-
246
- ### Script Usage
247
  ```bash
248
- # ASR
249
- $ cd examples_infer/asr
250
- $ bash inference_asr_aed.sh
251
- $ bash inference_asr_llm.sh
252
-
253
- # VAD & AED (Audio Event Detection)
254
- $ cd examples_infer/vad
255
- $ bash inference_vad.sh
256
- $ bash inference_streamvad.sh
257
- $ bash inference_aed.sh
258
-
259
- # LID
260
- $ cd examples_infer/lid
261
- $ bash inference_lid.sh
262
-
263
- # Punc
264
- $ cd examples_infer/punc
265
- $ bash inference_punc.sh
266
  ```
267
 
268
 
269
  ### Python API Usage
270
  Set up `PYTHONPATH` first: `export PYTHONPATH=$PWD/:$PYTHONPATH`
271
 
272
- #### ASR
273
- ```python
274
- from fireredasr2s.fireredasr2 import FireRedAsr2, FireRedAsr2Config
275
-
276
- batch_uttid = ["hello_zh", "hello_en"]
277
- batch_wav_path = ["assets/hello_zh.wav", "assets/hello_en.wav"]
278
-
279
- # FireRedASR2-AED
280
- asr_config = FireRedAsr2Config(
281
- use_gpu=True,
282
- use_half=False,
283
- beam_size=3,
284
- nbest=1,
285
- decode_max_len=0,
286
- softmax_smoothing=1.25,
287
- aed_length_penalty=0.6,
288
- eos_penalty=1.0,
289
- return_timestamp=True
290
- )
291
- model = FireRedAsr2.from_pretrained("aed", "pretrained_models/FireRedASR2-AED", asr_config)
292
- results = model.transcribe(batch_uttid, batch_wav_path)
293
- print(results)
294
- # [{'uttid': 'hello_zh', 'text': '你好世界', 'confidence': 0.971, 'dur_s': 2.32, 'rtf': '0.0870', 'wav': 'assets/hello_zh.wav', 'timestamp': [('你', 0.42, 0.66), ('好', 0.66, 1.1), ('世', 1.1, 1.34), ('界', 1.34, 2.039)]}, {'uttid': 'hello_en', 'text': 'hello speech', 'confidence': 0.943, 'dur_s': 2.24, 'rtf': '0.0870', 'wav': 'assets/hello_en.wav', 'timestamp': [('hello', 0.34, 0.98), ('speech', 0.98, 1.766)]}]
295
-
296
- # FireRedASR2-LLM
297
- asr_config = FireRedAsr2Config(
298
- use_gpu=True,
299
- decode_min_len=0,
300
- repetition_penalty=1.0,
301
- llm_length_penalty=0.0,
302
- temperature=1.0
303
- )
304
- model = FireRedAsr2.from_pretrained("llm", "pretrained_models/FireRedASR2-LLM", asr_config)
305
- results = model.transcribe(batch_uttid, batch_wav_path)
306
- print(results)
307
- # [{'uttid': 'hello_zh', 'text': '你好世界', 'rtf': '0.0681', 'wav': 'assets/hello_zh.wav'}, {'uttid': 'hello_en', 'text': 'hello speech', 'rtf': '0.0681', 'wav': 'assets/hello_en.wav'}]
308
- ```
309
-
310
-
311
- #### VAD
312
  ```python
313
- from fireredasr2s.fireredvad import FireRedVad, FireRedVadConfig
314
 
315
  vad_config = FireRedVadConfig(
316
  use_gpu=False,
@@ -331,12 +161,10 @@ print(result)
331
  ```
332
 
333
 
334
- #### Stream VAD
335
- <details>
336
- <summary>Click to expand</summary>
337
 
338
  ```python
339
- from fireredasr2s.fireredvad import FireRedStreamVad, FireRedStreamVadConfig
340
 
341
  vad_config=FireRedStreamVadConfig(
342
  use_gpu=False,
@@ -349,20 +177,17 @@ vad_config=FireRedStreamVadConfig(
349
  chunk_max_frame=30000)
350
  stream_vad = FireRedStreamVad.from_pretrained("pretrained_models/FireRedVAD/Stream-VAD", vad_config)
351
 
352
- frame_results, result = stream_vad.detect_full("assets/hello_zh.wav")
353
 
354
  print(result)
355
- # {'dur': 2.32, 'timestamps': [(0.46, 1.84)], 'wav_path': 'assets/hello_zh.wav'}
356
  ```
357
- </details>
358
 
359
 
360
- #### Audio Event Detection (AED)
361
- <details>
362
- <summary>Click to expand</summary>
363
 
364
  ```python
365
- from fireredasr2s.fireredvad import FireRedAed, FireRedAedConfig
366
 
367
  aed_config=FireRedAedConfig(
368
  use_gpu=False,
@@ -383,115 +208,9 @@ result, probs = aed.detect("assets/event.wav")
383
  print(result)
384
  # {'dur': 22.016, 'event2timestamps': {'speech': [(0.4, 3.56), (3.66, 9.08), (9.27, 9.77), (10.78, 21.76)], 'singing': [(1.79, 19.96), (19.97, 22.016)], 'music': [(0.09, 12.32), (12.33, 22.016)]}, 'event2ratio': {'speech': 0.848, 'singing': 0.905, 'music': 0.991}, 'wav_path': 'assets/event.wav'}
385
  ```
386
- </details>
387
-
388
-
389
- #### LID
390
- <details>
391
- <summary>Click to expand</summary>
392
-
393
- ```python
394
- from fireredasr2s.fireredlid import FireRedLid, FireRedLidConfig
395
-
396
- batch_uttid = ["hello_zh", "hello_en"]
397
- batch_wav_path = ["assets/hello_zh.wav", "assets/hello_en.wav"]
398
-
399
- config = FireRedLidConfig(use_gpu=True, use_half=False)
400
- model = FireRedLid.from_pretrained("pretrained_models/FireRedLID", config)
401
-
402
- results = model.process(batch_uttid, batch_wav_path)
403
- print(results)
404
- # [{'uttid': 'hello_zh', 'lang': 'zh mandarin', 'confidence': 0.996, 'dur_s': 2.32, 'rtf': '0.0741', 'wav': 'assets/hello_zh.wav'}, {'uttid': 'hello_en', 'lang': 'en', 'confidence': 0.996, 'dur_s': 2.24, 'rtf': '0.0741', 'wav': 'assets/hello_en.wav'}]
405
- ```
406
- </details>
407
-
408
-
409
- #### Punc
410
- <details>
411
- <summary>Click to expand</summary>
412
-
413
- ```python
414
- from fireredasr2s.fireredpunc.punc import FireRedPunc, FireRedPuncConfig
415
-
416
- config = FireRedPuncConfig(use_gpu=True)
417
- model = FireRedPunc.from_pretrained("pretrained_models/FireRedPunc", config)
418
-
419
- batch_text = ["你好世界", "Hello world"]
420
- results = model.process(batch_text)
421
-
422
- print(results)
423
- # [{'punc_text': '你好世界。', 'origin_text': '你好世界'}, {'punc_text': 'Hello world!', 'origin_text': 'Hello world'}]
424
- ```
425
- </details>
426
-
427
-
428
- #### ASR System
429
- ```python
430
- from fireredasr2s.fireredasr2 import FireRedAsr2Config
431
- from fireredasr2s.fireredlid import FireRedLidConfig
432
- from fireredasr2s.fireredpunc import FireRedPuncConfig
433
- from fireredasr2s.fireredvad import FireRedVadConfig
434
- from fireredasr2s import FireRedAsr2System, FireRedAsr2SystemConfig
435
-
436
- vad_config = FireRedVadConfig(
437
- use_gpu=False,
438
- smooth_window_size=5,
439
- speech_threshold=0.4,
440
- min_speech_frame=20,
441
- max_speech_frame=2000,
442
- min_silence_frame=20,
443
- merge_silence_frame=0,
444
- extend_speech_frame=0,
445
- chunk_max_frame=30000
446
- )
447
- lid_config = FireRedLidConfig(use_gpu=True, use_half=False)
448
- asr_config = FireRedAsr2Config(
449
- use_gpu=True,
450
- use_half=False,
451
- beam_size=3,
452
- nbest=1,
453
- decode_max_len=0,
454
- softmax_smoothing=1.25,
455
- aed_length_penalty=0.6,
456
- eos_penalty=1.0,
457
- return_timestamp=True
458
- )
459
- punc_config = FireRedPuncConfig(use_gpu=True)
460
-
461
- asr_system_config = FireRedAsr2SystemConfig(
462
- "pretrained_models/FireRedVAD/VAD",
463
- "pretrained_models/FireRedLID",
464
- "aed", "pretrained_models/FireRedASR2-AED",
465
- "pretrained_models/FireRedPunc",
466
- vad_config, lid_config, asr_config, punc_config,
467
- enable_vad=1, enable_lid=1, enable_punc=1
468
- )
469
- asr_system = FireRedAsr2System(asr_system_config)
470
-
471
- batch_uttid = ["hello_zh", "hello_en"]
472
- batch_wav_path = ["assets/hello_zh.wav", "assets/hello_en.wav"]
473
- for wav_path, uttid in zip(batch_wav_path, batch_uttid):
474
- result = asr_system.process(wav_path, uttid)
475
- print(result)
476
- # {'uttid': 'hello_zh', 'text': '你好世界。', 'sentences': [{'start_ms': 440, 'end_ms': 1820, 'text': '你好世界。', 'asr_confidence': 0.868, 'lang': 'zh mandarin', 'lang_confidence': 0.999}], 'vad_segments_ms': [(440, 1820)], 'dur_s': 2.32, 'words': [{'start_ms': 540, 'end_ms': 700, 'text': '你'}, {'start_ms': 700, 'end_ms': 1100, 'text': '好'}, {'start_ms': 1100, 'end_ms': 1300, 'text': '世'}, {'start_ms': 1300, 'end_ms': 1765, 'text': '界'}], 'wav_path': 'assets/hello_zh.wav'}
477
- # {'uttid': 'hello_en', 'text': 'Hello speech.', 'sentences': [{'start_ms': 260, 'end_ms': 1820, 'text': 'Hello speech.', 'asr_confidence': 0.933, 'lang': 'en', 'lang_confidence': 0.993}], 'vad_segments_ms': [(260, 1820)], 'dur_s': 2.24, 'words': [{'start_ms': 400, 'end_ms': 960, 'text': 'hello'}, {'start_ms': 960, 'end_ms': 1666, 'text': 'speech'}], 'wav_path': 'assets/hello_en.wav'}
478
- ```
479
-
480
 
481
 
482
  ## FAQ
483
  **Q: What audio format is supported?**
484
 
485
  16kHz 16-bit mono PCM wav. Use ffmpeg to convert other formats: `ffmpeg -i <input_audio_path> -ar 16000 -ac 1 -acodec pcm_s16le -f wav <output_wav_path>`
486
-
487
- **Q: What are the input length limitations of ASR models?**
488
-
489
- - FireRedASR2-AED supports audio input up to 60s. Input longer than 60s may cause hallucination issues, and input exceeding 200s will trigger positional encoding errors.
490
- - FireRedASR2-LLM supports audio input up to 30s. The behavior for longer input is untested.
491
-
492
-
493
- ## Acknowledgements
494
- Thanks to the following open-source works:
495
- - [Qwen](https://huggingface.co/Qwen)
496
- - [WenetSpeech-Yue](https://github.com/ASLP-lab/WenetSpeech-Yue)
497
- - [WenetSpeech-Chuan](https://github.com/ASLP-lab/WenetSpeech-Chuan)
 
4
  - en
5
  - zh
6
  tags:
7
+ - voice-activity-detection
8
  - Voice Acticity Detection
9
  - voice activity detection
10
  - speech activity detection
 
19
  - asr
20
  ---
21
 
22
+
23
  <div align="center">
24
  <h1>
25
+ FireRedVAD: A SOTA Industrial-Grade
26
  <br>
27
+ Voice Activity Detection & Audio Event Detection
28
  </h1>
29
 
30
  </div>
31
 
32
+ [[Code]](https://github.com/FireRedTeam/FireRedVAD)
33
+ [[HuggingFace]](https://huggingface.co/FireRedTeam/FireRedVAD)
34
+ [[ModelScope]](https://www.modelscope.cn/models/xukaituo/FireRedVAD)
 
35
 
36
 
37
+ FireRedVAD is a state-of-the-art (SOTA) industrial-grade Voice Activity Detection (VAD) and Audio Event Detection (AED) solution.
 
 
 
 
38
 
39
+ FireRedVAD supports non-streaming/streaming VAD and non-streaming AED. It supports speech/singing/music detection in 100+ languages. Non-streaming VAD achieves 97.57% F1 on FLEURS-VAD-102, outperforming Silero-VAD, TEN-VAD, FunASR-VAD and WebRTC-VAD.
40
 
41
 
42
  ## 🔥 News
43
+ - [2026.03.03] We release FireRedVAD as a standalone repository, along with model weights and inference code.
44
+ - [2026.02.12] We release [FireRedASR2S](https://github.com/FireRedTeam/FireRedASR2S) (FireRedASR2-AED, FireRedVAD, FireRedLID, and FireRedPunc) with model weights and inference code.
 
 
 
 
 
 
 
 
 
 
 
 
45
 
46
 
47
 
48
  ## Method
49
+ DFSMN-based non-streaming/streaming Voice Activity Detection and Audio Event Detection.
 
 
 
50
 
51
 
 
 
 
 
 
52
 
53
  ## Evaluation
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
  ### FireRedVAD
55
  We evaluate FireRedVAD on FLEURS-VAD-102, a multilingual VAD benchmark covering 102 languages.
56
 
 
68
  Note: FunASR-VAD achieves low Miss Rate but at the cost of high False Alarm Rate (44.03%), indicating over-prediction of speech segments.
69
 
70
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71
 
72
  ## Quick Start
73
  ### Setup
74
  1. Create a clean Python environment:
75
  ```bash
76
+ $ conda create --name fireredvad python=3.10
77
+ $ conda activate fireredvad
78
+ $ git clone https://github.com/FireRedTeam/FireRedVAD.git
79
+ $ cd FireRedVAD # or fireredvad
80
  ```
81
 
82
  2. Install dependencies and set up PATH and PYTHONPATH:
83
  ```bash
84
  $ pip install -r requirements.txt
85
+ $ export PATH=$PWD/fireredvad/bin/:$PATH
86
  $ export PYTHONPATH=$PWD/:$PYTHONPATH
87
  ```
88
 
 
90
  ```bash
91
  # Download via ModelScope (recommended for users in China)
92
  pip install -U modelscope
93
+ modelscope download --model xukaituo/FireRedVAD --local_dir ./pretrained_models/FireRedVAD
 
 
 
94
 
95
  # Download via Hugging Face
96
  pip install -U "huggingface_hub[cli]"
 
97
  huggingface-cli download FireRedTeam/FireRedVAD --local-dir ./pretrained_models/FireRedVAD
 
 
98
  ```
99
 
100
  4. Convert your audio to **16kHz 16-bit mono PCM** format if needed:
 
104
 
105
  ### Script Usage
106
  ```bash
107
+ $ cd examples
108
+ $ bash inference_vad.sh
109
+ $ bash inference_stream_vad.sh
110
+ $ bash inference_aed.sh
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
111
  ```
112
 
113
 
114
+ ### Command-line Usage
115
+ Set up `PATH` and `PYTHONPATH` first: `export PATH=$PWD/fireredvad/bin/:$PATH; export PYTHONPATH=$PWD/:$PYTHONPATH`
116
 
 
 
 
 
117
  ```bash
118
+ $ vad.py --help
119
+ $ vad.py --use_gpu 0 --model_dir pretrained_models/FireRedVAD/VAD --smooth_window_size 5 --speech_threshold 0.4 \
120
+ --min_speech_frame 20 --max_speech_frame 3000 --min_silence_frame 10 --merge_silence_frame 0 \
121
+ --extend_speech_frame 0 --chunk_max_frame 30000 --write_textgrid 1 \
122
+ --wav_path assets/hello_zh.wav --output out/vad.txt --save_segment_dir out/vad
123
+
124
+ $ stream_vad.py --help
125
+ $ stream_vad.py --use_gpu 0 --model_dir pretrained_models/FireRedVAD/Stream-VAD --smooth_window_size 5 --speech_threshold 0.3 \
126
+ --pad_start_frame 5 --min_speech_frame 8 --max_speech_frame 2000 --min_silence_frame 20 \
127
+ --chunk_max_frame 30000 --write_textgrid 1 \
128
+ --wav_path assets/hello_en.wav --output out/vad.txt --save_segment_dir out/stream_vad
129
+
130
+ $ aed.py --help
131
+ $ aed.py --use_gpu 0 --model_dir pretrained_models/FireRedVAD/AED --smooth_window_size 5 --speech_threshold 0.4 \
132
+ --singing_threshold 0.5 --music_threshold 0.5 --min_event_frame 20 --max_event_frame 3000 \
133
+ --min_silence_frame 10 --merge_silence_frame 0 --extend_speech_frame 0 --chunk_max_frame 30000 --write_textgrid 1 \
134
+ --wav_path assets/event.wav --output out/aed.txt --save_segment_dir out/aed
 
135
  ```
136
 
137
 
138
  ### Python API Usage
139
  Set up `PYTHONPATH` first: `export PYTHONPATH=$PWD/:$PYTHONPATH`
140
 
141
+ #### Non-streaming VAD
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
142
  ```python
143
+ from fireredvad import FireRedVad, FireRedVadConfig
144
 
145
  vad_config = FireRedVadConfig(
146
  use_gpu=False,
 
161
  ```
162
 
163
 
164
+ #### Streaming VAD
 
 
165
 
166
  ```python
167
+ from fireredvad import FireRedStreamVad, FireRedStreamVadConfig
168
 
169
  vad_config=FireRedStreamVadConfig(
170
  use_gpu=False,
 
177
  chunk_max_frame=30000)
178
  stream_vad = FireRedStreamVad.from_pretrained("pretrained_models/FireRedVAD/Stream-VAD", vad_config)
179
 
180
+ frame_results, result = stream_vad.detect_full("assets/hello_en.wav")
181
 
182
  print(result)
183
+ # {'dur': 2.24, 'timestamps': [(0.28, 1.83)], 'wav_path': 'assets/hello_en.wav'}
184
  ```
 
185
 
186
 
187
+ #### Non-streaming AED
 
 
188
 
189
  ```python
190
+ from fireredvad import FireRedAed, FireRedAedConfig
191
 
192
  aed_config=FireRedAedConfig(
193
  use_gpu=False,
 
208
  print(result)
209
  # {'dur': 22.016, 'event2timestamps': {'speech': [(0.4, 3.56), (3.66, 9.08), (9.27, 9.77), (10.78, 21.76)], 'singing': [(1.79, 19.96), (19.97, 22.016)], 'music': [(0.09, 12.32), (12.33, 22.016)]}, 'event2ratio': {'speech': 0.848, 'singing': 0.905, 'music': 0.991}, 'wav_path': 'assets/event.wav'}
210
  ```
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
211
 
212
 
213
  ## FAQ
214
  **Q: What audio format is supported?**
215
 
216
  16kHz 16-bit mono PCM wav. Use ffmpeg to convert other formats: `ffmpeg -i <input_audio_path> -ar 16000 -ac 1 -acodec pcm_s16le -f wav <output_wav_path>`