Views
No views yet
pyannote.audio version 3.1 or higher.wespeaker-voxceleb-resnet34-LM pretrained speaker embedding model, for use in pyannote.audio.1# instantiate pretrained model
2from pyannote.audio import Model
3model = Model.from_pretrained("pyannote/wespeaker-voxceleb-resnet34-LM")1from pyannote.audio import Inference
2inference = Inference(model, window="whole")
3embedding1 = inference("speaker1.wav")
4embedding2 = inference("speaker2.wav")
5# `embeddingX` is (1 x D) numpy array extracted from the file as a whole.
6
7from scipy.spatial.distance import cdist
8distance = cdist(embedding1, embedding2, metric="cosine")[0,0]
9# `distance` is a `float` describing how dissimilar speakers 1 and 2 are.1import torch
2inference.to(torch.device("cuda"))
3embedding = inference("audio.wav")1from pyannote.audio import Inference
2from pyannote.core import Segment
3inference = Inference(model, window="whole")
4excerpt = Segment(13.37, 19.81)
5embedding = inference.crop("audio.wav", excerpt)
6# `embedding` is (1 x D) numpy array extracted from the file excerpt.1from pyannote.audio import Inference
2inference = Inference(model, window="sliding",
3 duration=3.0, step=1.0)
4embeddings = inference("audio.wav")
5# `embeddings` is a (N x D) pyannote.core.SlidingWindowFeature
6# `embeddings[i]` is the embedding of the ith position of the
7# sliding window, i.e. from [i * step, i * step + duration].The pretrained model in WeNet follows the license of it's corresponding dataset. For example, the pretrained model on VoxCeleb follows Creative Commons Attribution 4.0 International License., since it is used as license of the VoxCeleb dataset, see https://mm.kaist.ac.kr/datasets/voxceleb/.
1@inproceedings{Wang2023,
2 title={Wespeaker: A research and production oriented speaker embedding learning toolkit},
3 author={Wang, Hongji and Liang, Chengdong and Wang, Shuai and Chen, Zhengyang and Zhang, Binbin and Xiang, Xu and Deng, Yanlei and Qian, Yanmin},
4 booktitle={ICASSP 2023, IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP)},
5 pages={1--5},
6 year={2023},
7 organization={IEEE}
8}1@inproceedings{Bredin23,
2 author={Hervé Bredin},
3 title={{pyannote.audio 2.1 speaker diarization pipeline: principle, benchmark, and recipe}},
4 year=2023,
5 booktitle={Proc. INTERSPEECH 2023},
6 pages={1983--1987},
7 doi={10.21437/Interspeech.2023-105}
8}