[G-API] Fix blocking desc usage#19738
Conversation
|
This going to fix: #19719 |
|
@AsyaPronina Could you have a look ? |
alalek
left a comment
There was a problem hiding this comment.
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 */); |
There was a problem hiding this comment.
{1, channels, height, width} /* dims */
...
{strideH * height, strideH, channels, 1} /* strides for dims */
Does strides correspond to dims after the change?
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
@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)
There was a problem hiding this comment.
https://docs.openvinotoolkit.org/latest/openvino_docs_IE_DG_Memory_primitives.html
Code after the fix looks good to me
|
@AsyaPronina The fix is OK ? |
Yes, thanks! |
|
@alalek Could you help with CI, please ? |
|
There is email notification about NCS2 stick in public CI (~1 week ago). The latest IE version should be used. |
bdc301c to
bad08d2
Compare
|
|
||
| const size_t strideH = mat.step[0]; | ||
|
|
||
| IE::BlockingDesc bdesc({1, height, width, channels} /* dims */, |
There was a problem hiding this comment.
looks like the original code actually is correct in terms of order for "blocked_dims", they should come in actual order NHWC..
There was a problem hiding this comment.
I agree. BlockedDims already describes the physical dimensions.
resolves #19719
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.
Build configuration