denoise_and_diarization / utils /diarization_pipeline.py
agorlanov
fix_readme
6144c99
raw
history blame
780 Bytes
from simple_diarizer.diarizer import Diarizer
class DiarizationPipeline:
def __init__(self, ):
super(DiarizationPipeline, self).__init__()
self.diar = Diarizer(
embed_model='ecapa', # supported types: ['xvec', 'ecapa']
cluster_method='ahc', # supported types: ['ahc', 'sc']
window=1, # size of window to extract embeddings (in seconds)
period=0.1 # hop of window (in seconds)
)
def __call__(self, wav_file):
segments = self.diar.diarize(wav_file,
num_speakers=None,
threshold=9e-1, )
return segments
diarization = DiarizationPipeline()
if __name__ == '__main__':
diarization('../converted.wav')