Skip to content

ONNX upscale reworked #2417

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

Merged
merged 5 commits into from
Jan 19, 2024

Conversation

adegerard
Copy link
Contributor

@adegerard adegerard commented Dec 18, 2023

Draft PR for information

What has been done

  • removed change_shape flag; assume all models are converted from pytorch (or other) but are in BCHW order
  • reworked like it has been done for pytorch
  • simple tests (CPU only)

TODO

  • validate with cuda
  • check some perf. optimizations
  • remove np2nptensor and nptensor2np?

- removed change_shape flag
- reworked like it has been done for pytorch
@adegerard
Copy link
Contributor Author

adegerard commented Dec 18, 2023

* removed `change_shape` flag; assume all models are converted from pytorch (or other) but are in BCHW order

Revert this change because rife models (even if not supported by chaiNNer) use a different order...

@joeyballentine
Copy link
Member

@adegerard Do you plan to finish this?

@adegerard
Copy link
Contributor Author

adegerard commented Jan 16, 2024

Sorry, I forgot.

I ended some tests: I have to check another time grayscale images.
I wonder whether I have to put back the possibility to change from BCHW to BHWC (onnx_auto_split function)
The reason is that is not implemented in pyTorch.
Except for rife onnx models, I found no other models with this property.

I have an implementation which supports this (not commited, and not tested because I currently have no model to test this)
What do you think?

@joeyballentine
Copy link
Member

I found no other models with this property.

Sorry that I didn't give context to this. This is common in models exported from tensorflow

@adegerard adegerard marked this pull request as ready for review January 16, 2024 19:16
@joeyballentine
Copy link
Member

Thanks for finishing it. I'll review it later today

Copy link
Member

@joeyballentine joeyballentine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thanks for this 👍

@joeyballentine joeyballentine merged commit 9dab78c into chaiNNer-org:main Jan 19, 2024
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 this pull request may close these issues.

2 participants