SAVRN
Search Contact SAVRN

Open-weight model

embedding

by Pyannote pyannote/embedding

Using this open-source model in production? Consider switching to pyannoteAI for better and faster options. This model is based on the canonical x-vector TDNN-based architecture, but with filter banks replaced with trainable SincNet features.

Parameters
Context
Weights102.1 MB
Licensemit
AccessAccess requested at publisher
Monthly Downloads918.9k

Model Card

By Pyannote, published under mit, revision 4db4899737a3.

Using this open-source model in production? Consider switching to pyannoteAI for better and faster options. This model is based on the canonical x-vector TDNN-based architecture, but with filter banks replaced with trainable SincNet features. See XVectorSincNet architecture for implementation details. Using cosine distance directly, this model reaches 2.8% equal error rate (EER) on VoxCeleb 1 test set. This is without voice activity detection (VAD) nor probabilistic linear discriminant analysis (PLDA). Expect even better results when adding one of those.

Read Pyannote's full model card

Using this open-source model in production?
Consider switching to pyannoteAI for better and faster options.

Speaker embedding

Relies on pyannote.audio 2.1: see installation instructions.

This model is based on the canonical x-vector TDNN-based architecture, but with filter banks replaced with trainable SincNet features. See XVectorSincNet architecture for implementation details.

Basic usage

# 1. visit hf.co/pyannote/embedding and accept user conditions
# 2. visit hf.co/settings/tokens to create an access token
# 3. instantiate pretrained model
from pyannote.audio import Model
model = Model.from_pretrained("pyannote/embedding", 
                              use_auth_token="ACCESS_TOKEN_GOES_HERE")
from pyannote.audio import Inference
inference = Inference(model, window="whole")
embedding1 = inference("speaker1.wav")
embedding2 = inference("speaker2.wav")
# `embeddingX` is (1 x D) numpy array extracted from the file as a whole.

from scipy.spatial.distance import cdist
distance = cdist(embedding1, embedding2, metric="cosine")[0,0]
# `distance` is a `float` describing how dissimilar speakers 1 and 2 are.

Using cosine distance directly, this model reaches 2.8% equal error rate (EER) on VoxCeleb 1 test set.
This is without voice activity detection (VAD) nor probabilistic linear discriminant analysis (PLDA). Expect even better results when adding one of those.

Advanced usage

Running on GPU

import torch
inference.to(torch.device("cuda"))
embedding = inference("audio.wav")

Extract embedding from an excerpt

from pyannote.audio import Inference
from pyannote.core import Segment
inference = Inference(model, window="whole")
excerpt = Segment(13.37, 19.81)
embedding = inference.crop("audio.wav", excerpt)
# `embedding` is (1 x D) numpy array extracted from the file excerpt.

Extract embeddings using a sliding window

from pyannote.audio import Inference
inference = Inference(model, window="sliding",
                      duration=3.0, step=1.0)
embeddings = inference("audio.wav")
# `embeddings` is a (N x D) pyannote.core.SlidingWindowFeature
# `embeddings[i]` is the embedding of the ith position of the 
# sliding window, i.e. from [i * step, i * step + duration].

Citation

@inproceedings{Bredin2020,
  Title = {{pyannote.audio: neural building blocks for speaker diarization}},
  Author = {{Bredin}, Herv{\'e} and {Yin}, Ruiqing and {Coria}, Juan Manuel and {Gelly}, Gregory and {Korshunov}, Pavel and {Lavechin}, Marvin and {Fustes}, Diego and {Titeux}, Hadrien and {Bouaziz}, Wassim and {Gill}, Marie-Philippe},
  Booktitle = {ICASSP 2020, IEEE International Conference on Acoustics, Speech, and Signal Processing},
  Address = {Barcelona, Spain},
  Month = {May},
  Year = {2020},
}
@inproceedings{Coria2020,
    author="Coria, Juan M. and Bredin, Herv{\'e} and Ghannay, Sahar and Rosset, Sophie",
    editor="Espinosa-Anke, Luis and Mart{\'i}n-Vide, Carlos and Spasi{\'{c}}, Irena",
    title="{A Comparison of Metric Learning Loss Functions for End-To-End Speaker Verification}",
    booktitle="Statistical Language and Speech Processing",
    year="2020",
    publisher="Springer International Publishing",
    pages="137--148",
    isbn="978-3-030-59430-5"
}

Identity and Version

Repository
pyannote/embedding
Publisher
Pyannote
Task
Not stated by the source
Modality
Other
Library
pyannote-audio
Parameters
Not stated by the source
Languages
Not stated by the source
Revision
4db4899737a38b2d618bbd74350915aa10293cb2
First published
2022-03-02
Last updated
2024-05-10

Files and Weights

10 files, 102.1 MB in total. The weights are 2 files totalling 102.1 MB in bin.

Weights2 files · 102.1 MB
Configuration4 files · 7.7 KB
Documentation2 files · 5.6 KB
Other1 file · —
Repository1 file · 690 B
Every file
FileTypeSizeSHA-256
pytorch_model.binWeights96.4 MB
tfevents.binWeights5.7 MB
config.yamlConfiguration2.0 KB
hparams.yamlConfiguration93 B
hydra.yamlConfiguration5.3 KB
overrides.yamlConfiguration315 B
LICENSEDocumentation1.1 KB
README.mdDocumentation4.5 KB
train.logOther
.gitattributesRepository690 B

License and Download

License
mit
Access
Access requested at publisher
Download size
102.1 MB
Request access from Pyannote

Pyannote grants access through its official repository on Hugging Face. Read the license.

Built From

  • Trained on (disclosed) voxceleb

Memory Requirements

PrecisionWeights in memory
As published102.1 MB

Weights only, from the published parameter count; the key-value cache and runtime add to this.

Questions About embedding

Can I use embedding commercially?

Yes. embedding is released under MIT License. The MIT License is a short permissive license. It permits commercial use, modification and redistribution, provided the copyright notice and permission notice are included.