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

OrtModelForImage2Image - For Onnx runtime on image-to-image tasks. #2030

Open
h3110Fr13nd opened this issue Sep 19, 2024 · 0 comments · May be fixed by #2031
Open

OrtModelForImage2Image - For Onnx runtime on image-to-image tasks. #2030

h3110Fr13nd opened this issue Sep 19, 2024 · 0 comments · May be fixed by #2031

Comments

@h3110Fr13nd
Copy link

Feature request

Optimum cli has an option to export "image-to-image" task. (https://huggingface.co/docs/optimum/en/exporters/onnx/overview)
However optimum doesn't support task type "image-to-image" for ONNX runtime. There needs to be an OrtModelForImage2Image for SuperResolution or Denoising or other similar tasktypes.

Motivation

It really is a mess to figure out how onnxruntime works. And I'm really used to the transformers and optimums pipeline features. But it really was a mess to learn the manual io bindings output_shape mismatch and all stuff for gpu inference. I want to pipeline it in a similar way.

When I tried

from optimum.pipelines import pipeline
pipe = pipeline("image-to-image")

It gives ValueError

ValueError: Task image-to-image is not supported for the ONNX Runtime pipeline. Supported tasks are ['feature-extraction', 'fill-mask', 'image-classification', 'image-segmentation', 'question-answering', 'text-classification', 'text-generation', 'token-classification', 'zero-shot-classification', 'summarization', 'translation', 'text2text-generation', 'automatic-speech-recognition', 'image-to-text', 'audio-classification']

However exporting to onnx works

optimum-cli export onnx -m caidas/swin2SR-realworld-sr-x4-64-bsrgan-psnr swin2sr-4x-onnx

Your contribution

I've started working on the task and will submit a PR Soon.

@h3110Fr13nd h3110Fr13nd linked a pull request Sep 19, 2024 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant