Closed
Conversation
alalek
commented
Oct 22, 2020
| opencv_onnx::TensorProto_DataType_Name(datatype)); | ||
| if (tensor_proto.dims_size() == 0) | ||
| blob.dims = 1; // To force 1-dimensional cv::Mat for scalars. | ||
| CV_CheckEQ(blob.dims, 1, "Tensor is scalar"); // ensure 1-dimensional cv::Mat for scalars |
Member
Author
There was a problem hiding this comment.
Current list of failed DNN tests require better and accurate handing of shapes in ONNX importer and probably in layers implementations.
We should use 0D tensor (scalar) here. 1D doesn't work properly.
6 tasks
Contributor
|
@fengyuentau, in the following comments I will mark the parts can be moved into a separate PR and polished/integrated separately. |
vpisarev
reviewed
Jul 16, 2022
| if( dims1 <= 2 && dims2 <= 2 && kind1 == kind2 && sz1 == sz2 && type1 == type2 && !haveMask ) | ||
| { | ||
| _dst.create(sz1, type1); | ||
| _dst.createSameSize(*psrc1, type1); |
vpisarev
reviewed
Jul 16, 2022
| { | ||
| int cn = src1.channels(); | ||
| _dst.create(src1.size(), CV_8UC(cn)); | ||
| _dst.createSameSize(src1, CV_8UC(cn)); |
vpisarev
reviewed
Jul 16, 2022
| _dst.create( size(), _type ); | ||
| else | ||
| _dst.create( dims, size, _type ); | ||
| _dst.create(src.dims, src.size, _type); |
vpisarev
reviewed
Jul 16, 2022
| CV_INSTRUMENT_REGION(); | ||
|
|
||
| CV_Assert(_img.dims() <= 2); | ||
| int dims = _img.dims(); |
vpisarev
reviewed
Jul 16, 2022
| std::swap(minLoc->x, minLoc->y); | ||
| if( maxLoc ) | ||
| std::swap(maxLoc->x, maxLoc->y); | ||
| if (minLoc) |
vpisarev
reviewed
Jul 16, 2022
| } | ||
|
|
||
|
|
||
| TEST(Mat1D, basic) |
Contributor
There was a problem hiding this comment.
the test would be useful to move to separate PR, but mark it as disabled for now
Member
|
Thank you @vpisarev ! Let me take a look into the code. |
6 tasks
a-sajjad72
pushed a commit
to a-sajjad72/opencv
that referenced
this pull request
Mar 30, 2023
Changes separated from Mat 1D support in core opencv#18594 (opencv#22346)
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.
WIP
calcHist()(returns 1D Mat, so minMaxLoc() fails due to(i, 0)instead of(0, i)results)