3D-Speaker is an open-source toolkit for single- and multi-modal speaker verification, speaker recognition, and speaker diarization. All pretrained models are accessible on ModelScope. Furthermore, we present a large-scale speech corpus also called 3D-Speaker-Dataset to facilitate the research of speech representation disentanglement.
Please support our community by starring it 感谢大家支持
The EER results on VoxCeleb, CNCeleb and 3D-Speaker datasets for fully-supervised speaker verification.
| Model | Params | VoxCeleb1-O | CNCeleb | 3D-Speaker |
|---|---|---|---|---|
| Res2Net | 4.03 M | 1.56% | 7.96% | 8.03% |
| ResNet34 | 6.34 M | 1.05% | 6.92% | 7.29% |
| ECAPA-TDNN | 20.8 M | 0.86% | 8.01% | 8.87% |
| ERes2Net-base | 6.61 M | 0.84% | 6.69% | 7.21% |
| CAM++ | 7.2 M | 0.65% | 6.78% | 7.75% |
| ERes2NetV2 | 17.8M | 0.61% | 6.14% | 6.52% |
| ERes2Net-large | 22.46 M | 0.52% | 6.17% | 6.34% |
The DER results on public and internal multi-speaker datasets for speaker diarization.
| Test | 3D-Speaker | pyannote.audio | DiariZen_WavLM |
|---|---|---|---|
| Aishell-4 | 10.30% | 12.2% | 11.7% |
| Alimeeting | 19.73% | 24.4% | 17.6% |
| AMI_SDM | 21.76% | 22.4% | 15.4% |
| VoxConverse | 11.75% | 11.3% | 28.39% |
| Meeting-CN_ZH-1 | 18.91% | 22.37% | 32.66% |
| Meeting-CN_ZH-2 | 12.78% | 17.86% | 18% |
git clone https://github.com/modelscope/3D-Speaker.git && cd 3D-Speaker
conda create -n 3D-Speaker python=3.8
conda activate 3D-Speaker
pip install -r requirements.txt
# Speaker verification: ERes2NetV2 on 3D-Speaker dataset
cd egs/3dspeaker/sv-eres2netv2/
bash run.sh
# Speaker verification: CAM++ on 3D-Speaker dataset
cd egs/3dspeaker/sv-cam++/
bash run.sh
# Speaker verification: ECAPA-TDNN on 3D-Speaker dataset
cd egs/3dspeaker/sv-ecapa/
bash run.sh
# Self-supervised speaker verification: SDPN on VoxCeleb dataset
cd egs/voxceleb/sv-sdpn/
bash run.sh
# Audio and multimodal Speaker diarization:
cd egs/3dspeaker/speaker-diarization/
bash run_audio.sh
bash run_video.sh
# Language identification
cd egs/3dspeaker/language-idenitfication
bash run.sh
All pretrained models are released on Modelscope.
# Install modelscope
pip install modelscope
# ERes2Net trained on 200k labeled speakers
model_id=iic/speech_eres2net_sv_zh-cn_16k-common
# ERes2NetV2 trained on 200k labeled speakers
model_id=iic/speech_eres2netv2_sv_zh-cn_16k-common
# CAM++ trained on 200k labeled speakers
model_id=iic/speech_campplus_sv_zh-cn_16k-common
# Run CAM++ or ERes2Net inference
python speakerlab/bin/infer_sv.py --model_id $model_id
# Run batch inference
python speakerlab/bin/infer_sv_batch.py --model_id $model_id --wavs $wav_list
# SDPN trained on VoxCeleb
model_id=iic/speech_sdpn_ecapa_tdnn_sv_en_voxceleb_16k
# Run SDPN inference
python speakerlab/bin/infer_sv_ssl.py --model_id $model_id
# Run diarization inference
python speakerlab/bin/infer_diarization.py --wav [wav_list OR wav_path] --out_dir $out_dir
# Enable overlap detection
python speakerlab/bin/infer_diarization.py --wav [wav_list OR wav_path] --out_dir $out_dir --include_overlap --hf_access_token $hf_access_token
The unified environment keeps the original 3D-Speaker VAD, CAM++ speaker embeddings, spectral clustering, and local-speaker alignment. Only the SincNet/BiLSTM segmentation frontend is replaceable:
| Backend | Role | Model |
|---|---|---|
pyannote-3.0 | Original overlap baseline | pyannote/segmentation-3.0 |
diarizen-large-s80-v2 | Scheme 1 | WavLM-Large/Conformer, up to 4 speakers per frame |
diarizen-base-s80 | Scheme 2 | WavLM-Base/Conformer, up to 2 speakers per frame |
Create and activate the isolated environment:
conda env create -f environment.yaml
conda activate 3dspeaker-diarizen
Run either DiariZen scheme (the models are public and do not require the gated pyannote token):
# Scheme 1: higher-capacity Large-s80-v2
python speakerlab/bin/infer_diarization.py \
--wav input.wav --out_dir output \
--segmentation_backend diarizen-large-s80-v2
# Scheme 2: faster Base-s80
python speakerlab/bin/infer_diarization.py \
--wav input.wav --out_dir output \
--segmentation_backend diarizen-base-s80
Use --model_cache_dir to share the ModelScope and Hugging Face cache.
--segmentation_batch_size and --segmentation_step override the official
defaults when memory or latency tuning is needed. The legacy
--include_overlap flag still selects pyannote-3.0 and must not be combined
with --segmentation_backend.
An independent stateful pipeline reuses the same CAM++ and pyannote segmentation-3.0 models while keeping the offline API and CLI unchanged. The default mode uses a 10 s model window, advances every 1 s, and emits immutable results with a 2 s fixed-lag aggregation policy:
python speakerlab/bin/infer_diarization_streaming.py \
--wav input_16k_mono.wav \
--out_dir streaming_output \
--hf_access_token "$HF_TOKEN"
The command simulates incoming audio with 100 ms chunks, prints each newly committed segment as a JSON line, and writes merged RTTM (or JSON) plus timing, RTF, configuration, and speaker-count metadata. It waits for the first 10 s window before producing output. Input must be mono 16 kHz, and numeric speaker IDs are stable only within one streaming session. See the streaming diarization guide for the Python API, lifecycle, thresholds, and latency semantics.
This integration does not use DiariZen's WeSpeaker embeddings, VBx clustering, or complete pipeline. DiariZen pretrained weights are licensed CC BY-NC 4.0 and are intended for non-commercial research use.
After batch inference, start the read-only subjective review tool:
python speakerlab/bin/serve_diarization_web.py
It automatically indexes inference_outputs, streams the original WAV files without modifying them, and supports waveform navigation, custom interval playback, continuous playback of one predicted speaker, and same-lane prediction/GT comparison with global speaker matching. See the diarization web viewer guide for intranet access and moved-path configuration.
Supervised Speaker Verification
CAM++, ERes2Net, ERes2NetV2, ECAPA-TDNN, ResNet and Res2Net training recipes on 3D-Speaker.
CAM++, ERes2Net, ERes2NetV2, ECAPA-TDNN, ResNet and Res2Net training recipes on VoxCeleb.
CAM++, ERes2Net, ERes2NetV2, ECAPA-TDNN, ResNet and Res2Net training recipes on CN-Celeb.
Self-supervised Speaker Verification
Speaker Diarization
Language Identification
3D-Speaker Dataset
If you have any comment or question about 3D-Speaker, please contact us by
3D-Speaker is released under the Apache License 2.0.
3D-Speaker contains third-party components and code modified from some open-source repos, including:
Speechbrain, Wespeaker, D-TDNN, DINO, Vicreg, TalkNet-ASD
, Ultra-Light-Fast-Generic-Face-Detector-1MB, pyannote.audio
If you find this repository useful, please consider giving a star :star: and citation :t-rex::
@article{chen20243d,
title={3D-Speaker-Toolkit: An Open Source Toolkit for Multi-modal Speaker Verification and Diarization},
author={Chen, Yafeng and Zheng, Siqi and Wang, Hui and Cheng, Luyao and others},
booktitle={ICASSP},
year={2025}
}
Python
56.9%
Shell
23.5%
Perl
12.7%
C++
2.9%
JavaScript
2.4%
3D-Speaker is an open-source toolkit for single- and multi-modal speaker verification, speaker recognition, and speaker diarization. All pretrained models are accessible on ModelScope. Furthermore, we present a large-scale speech corpus also called 3D-Speaker-Dataset to facilitate the research of speech representation disentanglement.
Please support our community by starring it 感谢大家支持
The EER results on VoxCeleb, CNCeleb and 3D-Speaker datasets for fully-supervised speaker verification.
| Model | Params | VoxCeleb1-O | CNCeleb | 3D-Speaker |
|---|---|---|---|---|
| Res2Net | 4.03 M | 1.56% | 7.96% | 8.03% |
| ResNet34 | 6.34 M | 1.05% | 6.92% | 7.29% |
| ECAPA-TDNN | 20.8 M | 0.86% | 8.01% | 8.87% |
| ERes2Net-base | 6.61 M | 0.84% | 6.69% | 7.21% |
| CAM++ | 7.2 M | 0.65% | 6.78% | 7.75% |
| ERes2NetV2 | 17.8M | 0.61% | 6.14% | 6.52% |
| ERes2Net-large | 22.46 M | 0.52% | 6.17% | 6.34% |
The DER results on public and internal multi-speaker datasets for speaker diarization.
| Test | 3D-Speaker | pyannote.audio | DiariZen_WavLM |
|---|---|---|---|
| Aishell-4 | 10.30% | 12.2% | 11.7% |
| Alimeeting | 19.73% | 24.4% | 17.6% |
| AMI_SDM | 21.76% | 22.4% | 15.4% |
| VoxConverse | 11.75% | 11.3% | 28.39% |
| Meeting-CN_ZH-1 | 18.91% | 22.37% | 32.66% |
| Meeting-CN_ZH-2 | 12.78% | 17.86% | 18% |
git clone https://github.com/modelscope/3D-Speaker.git && cd 3D-Speaker
conda create -n 3D-Speaker python=3.8
conda activate 3D-Speaker
pip install -r requirements.txt
# Speaker verification: ERes2NetV2 on 3D-Speaker dataset
cd egs/3dspeaker/sv-eres2netv2/
bash run.sh
# Speaker verification: CAM++ on 3D-Speaker dataset
cd egs/3dspeaker/sv-cam++/
bash run.sh
# Speaker verification: ECAPA-TDNN on 3D-Speaker dataset
cd egs/3dspeaker/sv-ecapa/
bash run.sh
# Self-supervised speaker verification: SDPN on VoxCeleb dataset
cd egs/voxceleb/sv-sdpn/
bash run.sh
# Audio and multimodal Speaker diarization:
cd egs/3dspeaker/speaker-diarization/
bash run_audio.sh
bash run_video.sh
# Language identification
cd egs/3dspeaker/language-idenitfication
bash run.sh
All pretrained models are released on Modelscope.
# Install modelscope
pip install modelscope
# ERes2Net trained on 200k labeled speakers
model_id=iic/speech_eres2net_sv_zh-cn_16k-common
# ERes2NetV2 trained on 200k labeled speakers
model_id=iic/speech_eres2netv2_sv_zh-cn_16k-common
# CAM++ trained on 200k labeled speakers
model_id=iic/speech_campplus_sv_zh-cn_16k-common
# Run CAM++ or ERes2Net inference
python speakerlab/bin/infer_sv.py --model_id $model_id
# Run batch inference
python speakerlab/bin/infer_sv_batch.py --model_id $model_id --wavs $wav_list
# SDPN trained on VoxCeleb
model_id=iic/speech_sdpn_ecapa_tdnn_sv_en_voxceleb_16k
# Run SDPN inference
python speakerlab/bin/infer_sv_ssl.py --model_id $model_id
# Run diarization inference
python speakerlab/bin/infer_diarization.py --wav [wav_list OR wav_path] --out_dir $out_dir
# Enable overlap detection
python speakerlab/bin/infer_diarization.py --wav [wav_list OR wav_path] --out_dir $out_dir --include_overlap --hf_access_token $hf_access_token
The unified environment keeps the original 3D-Speaker VAD, CAM++ speaker embeddings, spectral clustering, and local-speaker alignment. Only the SincNet/BiLSTM segmentation frontend is replaceable:
| Backend | Role | Model |
|---|---|---|
pyannote-3.0 | Original overlap baseline | pyannote/segmentation-3.0 |
diarizen-large-s80-v2 | Scheme 1 | WavLM-Large/Conformer, up to 4 speakers per frame |
diarizen-base-s80 | Scheme 2 | WavLM-Base/Conformer, up to 2 speakers per frame |
Create and activate the isolated environment:
conda env create -f environment.yaml
conda activate 3dspeaker-diarizen
Run either DiariZen scheme (the models are public and do not require the gated pyannote token):
# Scheme 1: higher-capacity Large-s80-v2
python speakerlab/bin/infer_diarization.py \
--wav input.wav --out_dir output \
--segmentation_backend diarizen-large-s80-v2
# Scheme 2: faster Base-s80
python speakerlab/bin/infer_diarization.py \
--wav input.wav --out_dir output \
--segmentation_backend diarizen-base-s80
Use --model_cache_dir to share the ModelScope and Hugging Face cache.
--segmentation_batch_size and --segmentation_step override the official
defaults when memory or latency tuning is needed. The legacy
--include_overlap flag still selects pyannote-3.0 and must not be combined
with --segmentation_backend.
An independent stateful pipeline reuses the same CAM++ and pyannote segmentation-3.0 models while keeping the offline API and CLI unchanged. The default mode uses a 10 s model window, advances every 1 s, and emits immutable results with a 2 s fixed-lag aggregation policy:
python speakerlab/bin/infer_diarization_streaming.py \
--wav input_16k_mono.wav \
--out_dir streaming_output \
--hf_access_token "$HF_TOKEN"
The command simulates incoming audio with 100 ms chunks, prints each newly committed segment as a JSON line, and writes merged RTTM (or JSON) plus timing, RTF, configuration, and speaker-count metadata. It waits for the first 10 s window before producing output. Input must be mono 16 kHz, and numeric speaker IDs are stable only within one streaming session. See the streaming diarization guide for the Python API, lifecycle, thresholds, and latency semantics.
This integration does not use DiariZen's WeSpeaker embeddings, VBx clustering, or complete pipeline. DiariZen pretrained weights are licensed CC BY-NC 4.0 and are intended for non-commercial research use.
After batch inference, start the read-only subjective review tool:
python speakerlab/bin/serve_diarization_web.py
It automatically indexes inference_outputs, streams the original WAV files without modifying them, and supports waveform navigation, custom interval playback, continuous playback of one predicted speaker, and same-lane prediction/GT comparison with global speaker matching. See the diarization web viewer guide for intranet access and moved-path configuration.
Supervised Speaker Verification
CAM++, ERes2Net, ERes2NetV2, ECAPA-TDNN, ResNet and Res2Net training recipes on 3D-Speaker.
CAM++, ERes2Net, ERes2NetV2, ECAPA-TDNN, ResNet and Res2Net training recipes on VoxCeleb.
CAM++, ERes2Net, ERes2NetV2, ECAPA-TDNN, ResNet and Res2Net training recipes on CN-Celeb.
Self-supervised Speaker Verification
Speaker Diarization
Language Identification
3D-Speaker Dataset
If you have any comment or question about 3D-Speaker, please contact us by
3D-Speaker is released under the Apache License 2.0.
3D-Speaker contains third-party components and code modified from some open-source repos, including:
Speechbrain, Wespeaker, D-TDNN, DINO, Vicreg, TalkNet-ASD
, Ultra-Light-Fast-Generic-Face-Detector-1MB, pyannote.audio
If you find this repository useful, please consider giving a star :star: and citation :t-rex::
@article{chen20243d,
title={3D-Speaker-Toolkit: An Open Source Toolkit for Multi-modal Speaker Verification and Diarization},
author={Chen, Yafeng and Zheng, Siqi and Wang, Hui and Cheng, Luyao and others},
booktitle={ICASSP},
year={2025}
}
Python
56.9%
Shell
23.5%
Perl
12.7%
C++
2.9%
JavaScript
2.4%