Skip to content

[G-API Wrap streaming#18493

Merged
alalek merged 6 commits intoopencv:masterfrom
TolyaTalamanov:at/wrap-streaming
Oct 14, 2020
Merged

[G-API Wrap streaming#18493
alalek merged 6 commits intoopencv:masterfrom
TolyaTalamanov:at/wrap-streaming

Conversation

@TolyaTalamanov
Copy link
Copy Markdown
Contributor

@TolyaTalamanov TolyaTalamanov commented Oct 2, 2020

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

Buildbot configuration

build_gapi_standalone:Linux x64=ade-0.1.1f
build_gapi_standalone:Win64=ade-0.1.1f
build_gapi_standalone:Mac=ade-0.1.1f
build_gapi_standalone:Linux x64 Debug=ade-0.1.1f

force_builders=ARMv7,Custom
Xbuild_image:Custom=centos:7
Xbuildworker:Custom=linux-1
Xbuild_gapi_standalone:Custom=ade-0.1.1f

Xforce_builders=Custom,Custom Win,Custom Mac
build_image:Custom=ubuntu-openvino-2020.4.0:16.04
build_image:Custom Win=openvino-2020.4.0
build_image:Custom Mac=openvino-2020.4.0

test_modules:Custom=dnn,python2,python3,java
test_modules:Custom Win=dnn,python2,python3,java
test_modules:Custom Mac=dnn,python2,python3,java

buildworker:Custom=linux-1
# disabled due high memory usage: test_opencl:Custom=ON
test_opencl:Custom=OFF
test_bigdata:Custom=1
test_filter:Custom=*

@TolyaTalamanov
Copy link
Copy Markdown
Contributor Author

@dkurt @dmatveev Could you take a look ?

@dmatveev
Copy link
Copy Markdown
Contributor

dmatveev commented Oct 5, 2020

Not the best reviewer here too. Please ping me when it is ready.

@TolyaTalamanov TolyaTalamanov force-pushed the at/wrap-streaming branch 2 times, most recently from d22d8e0 to fdfa6f8 Compare October 7, 2020 12:28
@TolyaTalamanov
Copy link
Copy Markdown
Contributor Author

@dkurt Could you take a look, please ?

@TolyaTalamanov
Copy link
Copy Markdown
Contributor Author

@dkurt

Copy link
Copy Markdown
Member

@dkurt dkurt left a comment

Choose a reason for hiding this comment

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

👍 Well done!

@dkurt dkurt self-assigned this Oct 8, 2020
// extracted from that arguments
GMetaArg GAPI_EXPORTS descr_of(const GRunArg &arg );
GMetaArgs GAPI_EXPORTS descr_of(const GRunArgs &args);
GMetaArgs GAPI_EXPORTS_W descr_of(const GRunArgs &args);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What is about the function above?

Bindings doesn't support overloads properly. Sometimes new names for overloads wrapping are required.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think only one overload should be in python in nearest future

* @sa GCompiled
*/
class GAPI_EXPORTS GStreamingCompiled
class GAPI_EXPORTS_W_SIMPLE GStreamingCompiled
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

GAPI_EXPORTS_W_SIMPLE is for simple key/value maps only (CV_PROP/CV_PROP_RW only).

It passes/handles arguments "by value".

Normal EXPORTS_W uses smart pointers for that and handles arguments "by reference". It should be used by default for classes.

IMHO, It is misused almost everywhere in gapi module.

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.

Copy link
Copy Markdown
Contributor Author

@TolyaTalamanov TolyaTalamanov Oct 9, 2020

Choose a reason for hiding this comment

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

I see, but if this object is returned from function which also wrapped, it should be SIMPLE
Net - https://github.com/opencv/opencv/blob/master/modules/dnn/include/opencv2/dnn/dnn.hpp#L390
function https://github.com/opencv/opencv/blob/master/modules/dnn/include/opencv2/dnn/dnn.hpp#L759

Because for CV_EXPORTS_W wrapper generates code for Ptr<Object> but function return Object by value, so it means in case Object is returned from function need to use CV_EXPORTS_W_SIMPLE, doesn't it ?

It's a reason why in G-API uses GAPI_EXPORTS_W_SIMPLE almost for all classes

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

So you are right, need to avoid it for objects which is not pimpl, but in case GCompiledStreaming it works fine. Opened a ticket

@TolyaTalamanov
Copy link
Copy Markdown
Contributor Author

@alalek Can it be merged ?

@alalek alalek merged commit 0d3e05f into opencv:master Oct 14, 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
[G-API Wrap streaming

* Wrap streaming

* Fix build

* Add comments

* Remove comment

* Fix comments to review

* Add test for python pull overload
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