Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Python API examples for speaker recognition with VAD and ASR. #532

Merged
merged 1 commit into from
Jan 15, 2024

Conversation

csukuangfj
Copy link
Collaborator

@csukuangfj csukuangfj commented Jan 15, 2024

Example 1: Speaker recognition + VAD

python3 ./python-api-examples/speaker-identification-with-vad.py \
  --silero-vad-model ./silero_vad.onnx \
  --threshold 0.5 \
  --model ./3dspeaker_speech_eres2net_large_sv_zh-cn_3dspeaker_16k.onnx \
  --speaker-file ./speaker.txt

Example 2: Speaker recognition + VAD + non-streaming ASR

python3 ./python-api-examples/speaker-identification-with-vad-non-streaming-asr.py \
  --paraformer ./sherpa-onnx-paraformer-zh-2023-03-28/model.int8.onnx \
  --tokens ./sherpa-onnx-paraformer-zh-2023-03-28/tokens.txt \
  --silero-vad-model ./silero_vad.onnx \
  --threshold 0.5 \
  --model ./3dspeaker_speech_eres2net_large_sv_zh-cn_3dspeaker_16k.onnx \
  --speaker-file ./speaker.txt

where speaker.txt contains:

雷军 ./sr-data/enroll/leijun-sr-1.wav
雷军 ./sr-data/enroll/leijun-sr-2.wav
fangjun ./sr-data/enroll/fangjun-sr-1.wav
fangjun ./sr-data/enroll/fangjun-sr-2.wav
fangjun ./sr-data/enroll/fangjun-sr-3.wav
刘德华 ./sr-data/enroll/liudehua-sr-1.wav
刘德华 ./sr-data/enroll/liudehua-sr-2.wav

You can find the test data sr-data at
https://github.com/csukuangfj/sr-data

@csukuangfj csukuangfj merged commit 59e2851 into k2-fsa:master Jan 15, 2024
139 of 145 checks passed
@csukuangfj csukuangfj deleted the python-speaker-recongition-vad branch January 15, 2024 13:40
XiaYucca pushed a commit to XiaYucca/sherpa-onnx that referenced this pull request Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant