Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[G-API] Extend compileStreaming to support different overloads #20555

Merged
merged 6 commits into from
Aug 24, 2021

Conversation

TolyaTalamanov
Copy link
Contributor

@TolyaTalamanov TolyaTalamanov commented Aug 15, 2021

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

Overview

The goal of this PR is to support all different overloads for compileStreaming method in python, such as:

  • compileStreaming(cv::GMetaArgs, cv::GCompileArgs = { })
  • compileStreaming(cv::ExtractMetaCallback, cv::GCompileArgs = { })
  • compileStreaming(cv::GCompileArgs = { })

To wrap these methods need to add GAPI_WRAP macros before every signature. The generated code will try every overloads in order from top to bottom as declared in c++ file and if overload isn't suitable (pyopencv_to for params return false) try the next one. So the problem was that pyopencv_to(cv::ExtractMetaCallback) always return true which means that the compileStreaming(cv::ExtractMetaCallback, cv::GCompileArgs = { }) is always suitable.
So the possible solution for that problem is put this overload in the end in that case it will be chosen only if others aren't suitable.

  • Added queue_capacity compile arg in order to test overloads.
  • Implemented pyopencv_to(cv::GMetaArg) in order to wrap compileStreaming(cv::GMetaArgs, cv::GCompileArgs)

Build configuration

force_builders=Custom,Custom Win,Custom Mac
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

Xbuild_image:Custom=centos:7
Xbuildworker:Custom=linux-1
build_gapi_standalone:Custom=ade-0.1.1f

build_image:Custom=ubuntu-openvino-2021.3.0:20.04
build_image:Custom Win=openvino-2021.2.0
build_image:Custom Mac=openvino-2021.2.0

test_modules:Custom=gapi,python2,python3,java
test_modules:Custom Win=gapi,python2,python3,java
test_modules:Custom Mac=gapi,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
Contributor Author

@mpashchenkov Could you have a look, please ?

@dmatveev dmatveev self-assigned this Aug 23, 2021
@dmatveev dmatveev added this to the 4.5.4 milestone Aug 23, 2021
Copy link
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.

LGTM but please address comments by @OrestChura

* Use macros for pyopencv_to GMetaArgs
* Use GAPI_PROP_RW
* Not split Prims python stuff
@alalek alalek merged commit 5ad6ff2 into opencv:master Aug 24, 2021
@alalek alalek mentioned this pull request Oct 15, 2021
a-sajjad72 pushed a commit to a-sajjad72/opencv that referenced this pull request Mar 30, 2023
…eaming-bug

[G-API] Extend compileStreaming to support different overloads

* Make different overloads

* Order python compileStreaming overloads

* Fix compileStreaming bug

* Replace

gin -> descr_of

* Set error message

* Fix review comments

* Use macros for pyopencv_to GMetaArgs
* Use GAPI_PROP_RW
* Not split Prims python stuff
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