Open APISeeker opened 7 months ago
I am not sure why you are getting 4 speakers but if you know the exact number of speakers then you can use num_speakers = 2 instead of min_speakers and max_speakers so it would be diarize_model(audio, num_speakers=2) https://github.com/m-bain/whisperX/blob/main/whisperx/diarize.py - line 28 also refer Controlling number of speakers here https://huggingface.co/pyannote/speaker-diarization-3.1
Thanks a lo, I will try it.
note that the CLI does not offer num_speakers.
Hello, I am new to this, How do you make sure it only find 2 speakers? I am trying to whisper a video where 2 persons speak but I am gettings results with multiple speakers I used this code: diarize_model(audio, min_speakers=2, max_speakers=2)
But I get this kind of results: .....[{'word': 'Welcome', 'start': 0.663, 'end': 0.903, 'score': 0.906, 'speaker': 'SPEAKER_00'}, {'word': 'back.', 'start': 0.943, 'end': 1.143, 'score': 0.928, 'speaker': 'SPEAKER_00'}], 'speaker': 'SPEAKER_00'}, {'start': 2.184, 'end': 2.745, 'text': 'Here we go again.', 'words': [{'word': 'Here', 'start': 2.184, 'end': 2.324, 'score': 0.766, 'speaker': 'SPEAKER_03'}
Notice how I have SPeaker 00 and 03 already! Elsewhere, I alsohave Speaker_02 and 01.. so that's 4 speakers, whereas my video has only 2!
Whay am I doing wrong? Full code: