pyannote / pyannote-audio

Neural building blocks for speaker diarization: speech activity detection, speaker change detection, overlapped speech detection, speaker embedding
http://pyannote.github.io
MIT License
6.26k stars 773 forks source link

Issue in offline use of speaker-diarization 3.1 model #1599

Closed ashu5644 closed 10 months ago

ashu5644 commented 10 months ago

@hbredin , I am trying to use speaker-diarization 3.1 model in offline mode , but I am getting following error:

sess = C.InferenceSession(session_options, self._model_path, True, self._read_config_from_model)
onnxruntime.capi.onnxruntime_pybind11_state.InvalidProtobuf: [ONNXRuntimeError] : 7 : INVALID_PROTOBUF : Load model from /home/ubuntu/workspace/pyannote_models/pyannote-wespeaker-voxceleb-resnet34-LM-embedding.bin failed:Protobuf parsing failed.

Code:

pipeline = Pipeline.from_pretrained('config.yaml')
pipeline.to('cuda')
audio_, _ = librosa.load('audio.wav', sr=16000)
audio = {"waveform": torch.tensor(np.reshape(audio_,(1,-1))), "sample_rate": 16000}
output = pipeline(audio)

config.yaml:


version: 3.1.0

pipeline:
  name: pyannote.audio.pipelines.SpeakerDiarization
  params:
    clustering: AgglomerativeClustering
    embedding: '/home/ubuntu/workspace/pyannote-wespeaker-voxceleb-resnet34-LM-embedding.bin'
    embedding_batch_size: 32
    embedding_exclude_overlap: true
    segmentation: '/home/ubuntu/workspace/pyannote_models/pyannote-segmentation-3.0-pytorch-model.bin'
    segmentation_batch_size: 32

params:
  clustering:
    method: centroid
    min_cluster_size: 12
    threshold: 0.7045654963945799
  segmentation:
    min_duration_off: 0.0

Similar code is working for speaker-diarization 3.0 in offline mode by replacing embedding argument in corresponding config with .onnx model path. But for speaker-diarization 3.1 no .onnx model exists here. Can you please suggest some workaround for this issue ?

Thank you.

github-actions[bot] commented 10 months ago

Thank you for your issue. We found the following entry in the FAQ which you may find helpful:

Feel free to close this issue if you found an answer in the FAQ.

If your issue is a feature request, please read this first and update your request accordingly, if needed.

If your issue is a bug report, please provide a minimum reproducible example as a link to a self-contained Google Colab notebook containing everthing needed to reproduce the bug:

Providing an MRE will increase your chance of getting an answer from the community (either maintainers or other power users).

Companies relying on pyannote.audio in production may contact me via email regarding:

This is an automated reply, generated by FAQtory

ashu5644 commented 10 months ago

Solved by upgrading to pyannote.audio 3.1

seanzhang-zhichen commented 8 months ago

Solved by upgrading to pyannote.audio 3.1

unuseful