How to get cluster centroids from NeuralDiarizer #15072
Replies: 2 comments 1 reply
-
|
Hi. Get access to the raw speaker labels obtained from the clustering at here : Then use those labels to find the centroid of these embeddings: The main clustering algo is in Note that NeMo now offers an end-to-end streaming diarization model called Sortformer (streaming version). However, end-to-end version makes you hard to get the centroids so clustering diarization would serve for your purpose. |
Beta Was this translation helpful? Give feedback.
-
|
Hi @tango4j, Thanks for your response! Just to clarify, I’m using the From my understanding, the from nemo.collections.asr.models import NeuralDiarizer
from pyannote.audio import Annotation
model = NeuralDiarizer.from_pretrained(
model_name= str(Path(self.config.cache_dir)/self.config.nemo.model_name),
vad_model_name= str(Path(self.config.cache_dir)/self.config.nemo.vad_model_name) if self.config.nemo.vad_model_name else None,
map_location= self.config.device,
verbose= self.config.verbose,
)
diarization: Annotation = self.model(
audio_filepath, num_speakers = self.config.num_speakers,
# max_speakers= self.config.num_speakers,
num_workers=0, verbose= True)
emb_sess_avg_dict = model.clustering_embedding.emb_sess_test_dict
for scale_idx, session_dict in emb_sess_avg_dict.items():
for uniq_id, emb_info in session_dict.items():
avg_embs = emb_info['avg_embs'] # shape: [embedding_dim, max_speakers]A few questions:
Just wanted to confirm I’m not missing anything, since it looks like the pipeline already provides what I need. Thanks! |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
-
Hi @nithinraok ,
I’m using
NeuralDiarizerand want to access the cluster centroids for each speaker (after clustering). I’d like to use these for speaker verification or matching speakers across sessions.Is there a clean way to extract or save these centroids from the diarizer pipeline?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions