Skip to content

G-API: Introduce abstract base classes for GExecutor and GStreamingExecutor#22451

Merged
asmorkalov merged 2 commits intoopencv:4.xfrom
dmatveev:dm/abstract_execs
Sep 9, 2022
Merged

G-API: Introduce abstract base classes for GExecutor and GStreamingExecutor#22451
asmorkalov merged 2 commits intoopencv:4.xfrom
dmatveev:dm/abstract_execs

Conversation

@dmatveev
Copy link
Copy Markdown
Contributor

The classes are GAbstractExecutor and GAbstractStreamingExecutor, respectively.

The idea behind this simple refactoring is to introduce other execution policies (implemented by executors) in the near future.

Note: this PR replaces obsolete #21762 and #21816 -- which now can be closed.

  • 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 another license that is incompatible with OpenCV
  • The PR is proposed to the proper branch
  • There is a reference to the 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

GExecutor is now a subclass of GAbstractExecutor. Other to come
Now GStreamingExecutor is its subclass; others to come
void start() override;
bool pull(cv::GRunArgsP &&outs) override;
bool pull(cv::GOptRunArgsP &&outs) override;
PyPullResult pull() override;
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.

Since GStreamingExecutor isn't exposed to python directly (only via GStreamingCompiled) it doesn't affect python, because PyPullResult matches to this API: https://github.com/opencv/opencv/blob/4.x/modules/gapi/include/opencv2/gapi/gstreaming.hpp#L277

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.

Python parser knows how to parse std::tuple<bool, cv::util::variant<cv::GRunArgs, cv::GOptRunArgs>>, but don't know anything about PyPullResult which isn't used.

Copy link
Copy Markdown
Contributor

@TolyaTalamanov TolyaTalamanov left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@TolyaTalamanov
Copy link
Copy Markdown
Contributor

All streaming python tests work fine, proceed with merge.

@asmorkalov
Copy link
Copy Markdown
Contributor

@dmatveev Is the patch ready for merge?

@dmatveev
Copy link
Copy Markdown
Contributor Author

dmatveev commented Sep 9, 2022

@asmorkalov yes, thanks!

@asmorkalov asmorkalov merged commit c9060b0 into opencv:4.x Sep 9, 2022
@alalek alalek mentioned this pull request Jan 8, 2023
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