Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ONNX compatibility #204

Merged
merged 8 commits into from
Nov 11, 2023
Merged

Add ONNX compatibility #204

merged 8 commits into from
Nov 11, 2023

Conversation

juanmc2005
Copy link
Owner

@juanmc2005 juanmc2005 commented Nov 9, 2023

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")

@juanmc2005 juanmc2005 added the feature New feature or request label Nov 9, 2023
@juanmc2005 juanmc2005 added this to the Version 0.9 milestone Nov 9, 2023
@juanmc2005 juanmc2005 merged commit 0511dec into develop Nov 11, 2023
3 checks passed
@juanmc2005 juanmc2005 deleted the onnx branch November 11, 2023 12:07
juanmc2005 added a commit that referenced this pull request Nov 11, 2023
* Add ONNX segmentation and embedding models

* Minor readability improvements

* Replace onnxruntime with onnxruntime-gpu

* ONNX can have only one output

* Clean up useless embedding model subclasses

* Remove duration and sample_rate properties from SegmentationModel. Clean up code

* Update README
@juanmc2005 juanmc2005 mentioned this pull request Nov 18, 2023
juanmc2005 added a commit that referenced this pull request Nov 19, 2023
* Add ONNX segmentation and embedding models

* Minor readability improvements

* Replace onnxruntime with onnxruntime-gpu

* ONNX can have only one output

* Clean up useless embedding model subclasses

* Remove duration and sample_rate properties from SegmentationModel. Clean up code

* Update README
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant