Skip to content

[G-API] Fix blocking desc usage#19738

Merged
opencv-pushbot merged 1 commit intoopencv:masterfrom
TolyaTalamanov:at/giebackend-blockingdesc-fix
Mar 19, 2021
Merged

[G-API] Fix blocking desc usage#19738
opencv-pushbot merged 1 commit intoopencv:masterfrom
TolyaTalamanov:at/giebackend-blockingdesc-fix

Conversation

@TolyaTalamanov
Copy link
Copy Markdown
Contributor

@TolyaTalamanov TolyaTalamanov commented Mar 17, 2021

resolves #19719

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 Apache 2 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

Build configuration

Xforce_builders_only=linux,docs
force_builders=Custom,Custom Win,Custom Mac
build_gapi_standalone:Linux x64=ade-0.1.1f
build_gapi_standalone:Win64=ade-0.1.1f
build_gapi_standalone:Mac=ade-0.1.1f
build_gapi_standalone:Linux x64 Debug=ade-0.1.1f

Xbuild_image:Custom=centos:7
Xbuildworker:Custom=linux-1
build_gapi_standalone:Custom=ade-0.1.1f

build_image:Custom=ubuntu-openvino-2021.1.0:20.04
build_image:Custom Win=openvino-2021.1.0
build_image:Custom Mac=openvino-2021.2.0

test_modules:Custom=gapi,python2,python3,java
test_modules:Custom Win=gapi,python2,python3,java
test_modules:Custom Mac=gapi,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=*

@TolyaTalamanov
Copy link
Copy Markdown
Contributor Author

This going to fix: #19719

@TolyaTalamanov
Copy link
Copy Markdown
Contributor Author

@AsyaPronina Could you have a look ?

Copy link
Copy Markdown
Member

@alalek alalek left a comment

Choose a reason for hiding this comment

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

It make sense to add C++ regression test for that case.

{0, 2, 3, 1} /* order for NHWC */,
0 /* offset */,
{0, 0, 0, 0} /* offsets for dims */,
{strideH * height, strideH, channels, 1} /* strides for dims */);
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.

{1, channels, height, width} /* dims */
...
{strideH * height, strideH, channels, 1} /* strides for dims */

Does strides correspond to dims after the change?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Usually dims follow in logical order - NCHW, but strides describe actual layout.
The problem was in step we don't need to consider size of precision in bytes there.
For instance: CV_FLOAT32C3 - 3 elements in strides, but we used 3 * sizeof(float)

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.

@ilya-lavrenov Could you please take a look how to properly pass cv::Mat to InferenceEngine here? (or point to some example in IE / OMZ)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@TolyaTalamanov
Copy link
Copy Markdown
Contributor Author

@AsyaPronina The fix is OK ?

@AsyaPronina
Copy link
Copy Markdown
Contributor

@AsyaPronina The fix is OK ?

Yes, thanks!

@TolyaTalamanov
Copy link
Copy Markdown
Contributor Author

@alalek
Copy link
Copy Markdown
Member

alalek commented Mar 18, 2021

There is email notification about NCS2 stick in public CI (~1 week ago). The latest IE version should be used.

@TolyaTalamanov TolyaTalamanov force-pushed the at/giebackend-blockingdesc-fix branch from bdc301c to bad08d2 Compare March 19, 2021 09:48
@opencv-pushbot opencv-pushbot merged commit 3f52d0e into opencv:master Mar 19, 2021

const size_t strideH = mat.step[0];

IE::BlockingDesc bdesc({1, height, width, channels} /* dims */,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

looks like the original code actually is correct in terms of order for "blocked_dims", they should come in actual order NHWC..

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I agree. BlockedDims already describes the physical dimensions.

@alalek alalek mentioned this pull request Apr 9, 2021
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.

G-API: Python tests failed in builds with OpenVINO

6 participants