Skip to content

Fix loading of ONNX models with Resize operation with Opset 11 for newer versions of Pytorch#18316

Merged
alalek merged 3 commits intoopencv:3.4from
sl-sergei:fix_18253
Sep 17, 2020
Merged

Fix loading of ONNX models with Resize operation with Opset 11 for newer versions of Pytorch#18316
alalek merged 3 commits intoopencv:3.4from
sl-sergei:fix_18253

Conversation

@sl-sergei
Copy link
Copy Markdown
Contributor

With Pytorch ver. 1.6 (or newer) onnx importer with Opset 11 stores scales parameter as float32.

relates: #18253 and #18300

merge with extra: opencv/opencv_extra#806

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under OpenCV (BSD) License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or other license that is incompatible with OpenCV
  • The PR is proposed to proper branch
  • There is reference to original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake
opencv_extra=testdata_for_resize_opset11
force_builders=Custom,Custom Win,Custom Mac
build_image:Custom=ubuntu-openvino-2020.4.0:16.04
build_image:Custom Win=openvino-2020.3.0
build_image:Custom Mac=openvino-2020.3.0

test_modules:Custom=dnn,python2,python3,java
test_modules:Custom Win=dnn,python2,python3,java
test_modules:Custom Mac=dnn,python2,python3,java

buildworker:Custom=linux-1
# disabled due high memory usage: test_opencl:Custom=ON
test_opencl:Custom=OFF
test_bigdata:Custom=1
test_filter:Custom=*

Copy link
Copy Markdown
Member

@dkurt dkurt left a comment

Choose a reason for hiding this comment

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

👍 Thank you!

@dkurt dkurt self-assigned this Sep 11, 2020
@asmorkalov
Copy link
Copy Markdown
Contributor

@mshabunin could you merge the patch?

CV_CheckEQ(shapes.size[0], 4, "");
CV_CheckEQ(shapes.size[1], 1, "");
CV_CheckTypeEQ(shapes.depth(), CV_32S, "");
CV_Check(shapes.depth(), shapes.depth() == CV_32S || shapes.depth() == CV_32F, "");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

-CV_Check
+CV_CheckDepth

for better diagnostic messages.

@berak
Copy link
Copy Markdown
Contributor

berak commented Sep 15, 2020

thanks ! using your fix, https://github.com/princeton-vl/YouTube3D works now with opencv ;)

@alalek alalek merged commit fa953e4 into opencv:3.4 Sep 17, 2020
@dkurt
Copy link
Copy Markdown
Member

dkurt commented Sep 17, 2020

relates: #18253 and #18300

please close if the issues have been resolved

@alalek alalek mentioned this pull request Sep 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants