[G-API] Introduce cv.gin/cv.descr_of for python#19322
Conversation
f0ac408 to
92b3cdd
Compare
92b3cdd to
a8a96cf
Compare
|
@dmatveev @smirnov-alexey Could you take a look ? |
|
@dmatveev @smirnov-alexey Could you take a look ? |
|
@dmatveev Should we ignore this warning ? Does it make sense to shorten |
I guess it breaks the build so you need to fix it anyway |
46ca990 to
606cd97
Compare
…ov/opencv into at/python-callbacks
|
@dmatveev Could you take a look, please ? |
dmatveev
left a comment
There was a problem hiding this comment.
The approach is still questionable.
Please setup a follow-up call to discuss.
854e47e to
eb0a4af
Compare
f07cf3e to
db14b51
Compare
db14b51 to
27a8694
Compare
dmatveev
left a comment
There was a problem hiding this comment.
Oh seems I failed to submit a review at the time - sorry for that
9cf3a03 to
76fec86
Compare
30e220e to
76c177a
Compare
|
@alalek I hope all are passed! |
* Avoid using default in switches
76c177a to
836e17c
Compare
f11e192 to
a9eb499
Compare
a9eb499 to
b521efe
Compare
|
@alalek all checks are passed, can it be merged ? |
[G-API] Introduce cv.gin/cv.descr_of for python * Implement cv.gin/cv.descr_of * Fix macos build * Fix gcomputation tests * Add test * Add using to a void exceeded length for windows build * Add using to a void exceeded length for windows build * Fix comments to review * Fix comments to review * Update from latest master * Avoid graph compilation to obtain in/out info * Fix indentation * Fix comments to review * Avoid using default in switches * Post output meta for giebackend
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.
Overview
This PR is a part of #18900. To make review process easier decided to split this on several PR's.
Problem
To pass input arguments into
GComputation::applyG-API has functioncv::gin()which takes variadic number of arguments and makecv::GRunArgsfrom them.Let's to consider this call:
Both of
imgand array arenumpyarrays, but the first one should be represented ascv::Matand the second asstd::vectorbased on graph meta of course.Another example: Both of
cv::Scalarandcv::Rectare represented in python as tuple with 4 values.The same problem for
cv::descr_of.How to implement
cv::ginfor python, if we don't know actual type of object and have only python representation like numpy array or tuple.Solution
We can't unpack input
PyObject*tocv::GRunArgsat the time we received it incv::gin. But we can unpack data based on graph metadata. Let's create some functor which stores thisPyObject*and implement method which will take input metadata and based on this metadata perform converting.cv.ginmake thefunctorand return back to the python.functorinapplymethod and unpack based on collected input meta.Build configuration