ONNX: Add support for Style trasfer models, ONNX model zoo#16709
Merged
opencv-pushbot merged 1 commit intoopencv:3.4from Mar 3, 2020
ashishkrshrivastava:cvonnx
Merged
ONNX: Add support for Style trasfer models, ONNX model zoo#16709opencv-pushbot merged 1 commit intoopencv:3.4from ashishkrshrivastava:cvonnx
opencv-pushbot merged 1 commit intoopencv:3.4from
ashishkrshrivastava:cvonnx
Conversation
dkurt
reviewed
Mar 1, 2020
dkurt
reviewed
Mar 1, 2020
dkurt
reviewed
Mar 1, 2020
6 tasks
Contributor
Author
|
@dkurt, So you want me to remove Gather-Cast related changes and only keep Mul-Cast related changes ? |
Member
|
@ashishkrshrivastava, no, please keep both Gather-Cast and Mul-Cast but remove |
Member
|
Please resolve merge conflicts (rebase with updated 3.4) |
Contributor
Author
Thank you so much 👍 |
Merged
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
resolves #16707
Merge with extra: opencv/opencv_extra#719
opencv_extra=cvonnxPull Request Readiness Checklist
Patch to opencv_extra has the same branch name.
This PR adds :
Detailed Description
Different Pytorch versions create different subgraphs, according to what I have observed till now, the difference is only because of presence or absence of cast layer after Gather and Mul layer. The idea is to fuse Gather-Cast and Mul-Cast . Hence presence or absence of Cast layer wouldn't make any affect on loading of model.
Below attached, three different subgraphs obtained using same code but different pytorch versions. Producer of Fast style transfer models is Pytorch 1.1, which is middle subgraph in attached image . PR #16573 added support for only first subgraph. This PR adds support for all three subgraphs.
Merging these changes
would allow loading of all Style trasfer models of ONNX model Zoo which includes: