Skip to content

G-API: ONNX. Support tensor input for CNN with dynamic input #18744

Merged
alalek merged 12 commits intoopencv:masterfrom
mpashchenkov:mp/onnx-dynamic-input-tensor
Nov 16, 2020
Merged

G-API: ONNX. Support tensor input for CNN with dynamic input #18744
alalek merged 12 commits intoopencv:masterfrom
mpashchenkov:mp/onnx-dynamic-input-tensor

Conversation

@mpashchenkov
Copy link
Copy Markdown
Contributor

@mpashchenkov mpashchenkov commented Nov 6, 2020

ONNX. Support tensor input for CNN with dynamic input

  • Changed assert for CV_32F case. Added test.

Added new tests and refactored olds.

New tests:

  • InferTensor;
  • InferDynamicInputTensor;
  • Infer(Gray)Image;
  • InferMultiNodes.

Refactored tests:

  • Infer;
  • InferROI;
  • InferROIList;
  • Infer2ROIList.

Tests contain unsupported(OCV bb) models:

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
force_builders=Custom
buildworker:Custom=linux-1
build_image:Custom=ubuntu-onnx:20.04
test_modules:Custom=gapi
test_filter:Custom=*ONNX*

Copy link
Copy Markdown
Contributor

@OrestChura OrestChura left a comment

Choose a reason for hiding this comment

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

Great tests!

@mpashchenkov
Copy link
Copy Markdown
Contributor Author

@alalek Please add tinyyolov2-8.onnx for bb custom ONNX.

I added it to PR description.

One test throws: Can't find required data file: vision/object_detection_segmentation/tiny-yolov2/model/tinyyolov2-8.onnx

Copy link
Copy Markdown
Contributor

@OrestChura OrestChura left a comment

Choose a reason for hiding this comment

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

Thanks!

@mpashchenkov
Copy link
Copy Markdown
Contributor Author

mpashchenkov commented Nov 10, 2020

@dmatveev Last words about it.

Copy link
Copy Markdown
Contributor

@dmatveev dmatveev left a comment

Choose a reason for hiding this comment

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

"Approved with comments" 👍

Please fix the stuff in the follow-up MR.

const int size = in.total();
for (int i = 0; i < size; ++i) {
optr[i] = inptr[i];
}
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.

Mat::copyTo() is enough, assuming sizes are equal.

@alalek alalek merged commit 0647774 into opencv:master Nov 16, 2020
@alalek alalek mentioned this pull request Nov 27, 2020
a-sajjad72 pushed a commit to a-sajjad72/opencv that referenced this pull request Mar 30, 2023
…ut-tensor

G-API: ONNX. Support tensor input for CNN with dynamic input 

* Added support for dynamic input tensor, refactored one input/output tests

* Added multiple input/output fixture, test for mobilenet

* Removed whitespace

* Removed mistake in inferROI

* Small fixes

* One more fix

* Code cleanup

* Code cleanup X2

* bb rstrt

* Fix review comments

* One more fix review comments

* Mistake
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.

4 participants