juanmc2005 / diart

A python package to build AI-powered real-time audio applications
https://diart.readthedocs.io
MIT License
1.02k stars 87 forks source link

Add ONNX compatibility #204

Closed juanmc2005 closed 10 months ago

juanmc2005 commented 11 months ago

Addresses #202

Example usage

Using from_pretrained() automatically figures out whether it's a pyannote model or an ONNX model.

The same API can be used with EmbeddingModel

from diart.models import SegmentationModel

segmentation = SegmentationModel.from_onnx("my_segmentation.onnx", input_name="x", output_name="outs")
# or even
segmentation = SegmentationModel.from_pretrained("my_segmentation.onnx")
segmentation = SegmentationModel.from_pretrained("pyannote/segmentation")
segmentation = SegmentationModel.from_pretrained("my_segmentation.bin")