G-API: ONNX. Support for networks with three dimensional input.#18943
G-API: ONNX. Support for networks with three dimensional input.#18943alalek merged 7 commits intoopencv:masterfrom
Conversation
|
@mpashchenkov Friendly reminder. |
| const int padded_h = std::ceil(new_h / div) * div; | ||
| const int padded_w = std::ceil(new_w / div) * div; | ||
| int type = -1; | ||
| // is_hwc - Mat has C*H, W dimensions |
There was a problem hiding this comment.
This comment should be vice versa, right? if Mat is_not_hwc, i. e. CHW => dimensions [C*H, W, 1]
There was a problem hiding this comment.
Removed after "padding" discussion.
What is |
|
Removed padding from preprocessing after discussing possible troubles. |
dmatveev
left a comment
There was a problem hiding this comment.
Looks good but not sure if the std::string/std::wstring conversion is done right
dmatveev
left a comment
There was a problem hiding this comment.
"Approved with comments"
| #include <string> | ||
| #include <array> | ||
| #include <tuple> // tuple, tuple_size | ||
| #include <codecvt> // wstring_convert |
There was a problem hiding this comment.
Please move it to .cpp if you only need it in .cpp.
There was a problem hiding this comment.
Tests use conversion to wstring on Windows.
There was a problem hiding this comment.
Then tests should include this, but not your generic public header.
There was a problem hiding this comment.
@alalek, Moved #include <codecvt> from onnx.hpp
d32feba to
2f4f7f0
Compare
dmatveev
left a comment
There was a problem hiding this comment.
Please avoid extra includes in public headers.
|
@alalek, could you merge this? |
You have ARs from @dmatveev : #18943 (comment) |
G-API: ONNX. Support for networks with three dimensional input. * Padding without tests * Removed padding * Some small fixes * Added wstring_convert * Alignment fix, m b * Small fixes * Moved include from onnx.hpp
We can call infer with images (not tensors) for networks like this:
https://github.com/onnx/models/tree/master/vision/object_detection_segmentation/faster-rcnn#input-to-model
Fix for build on Windows (ort::Session on Windows expects wchar_t* instead char*).
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.