G-API: Introduce runtime in-graph metadata#18793
Merged
alalek merged 6 commits intoopencv:masterfrom Nov 17, 2020
Merged
Conversation
TolyaTalamanov
approved these changes
Nov 13, 2020
rgarnov
requested changes
Nov 13, 2020
Contributor
Author
|
@smirnov-alexey @TolyaTalamanov @rgarnov can you please have a look one more time? Thanks |
Contributor
Author
|
@alalek done. |
Contributor
Author
|
Fantastic! |
Merged
a-sajjad72
pushed a commit
to a-sajjad72/opencv
that referenced
this pull request
Mar 30, 2023
G-API: Introduce runtime in-graph metadata * G-API: In-graph metadata -- initial implementation * G-API: Finish the in-graph metadata implementation for Streaming * G-API: Fix standalone build & warnings for in-graph metadata * G-API: In-graph meta -- fixed review comments * G-API: Fix issues with desync causing failing tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
also resolves #18773
Intro
This PR brings support of generic in-graph metadata in the G-API.
The metadata comes into graph with its input arguments and propagates through the graph then.
The main idea behind this metadata today is to tag every object with extra streaming-related info (e.g., a frame number and a timestamp) to allow app-side data synchronization when
streaming::desync()feature is used (see tests).Overview of changes
cv::GRunArgis not an alias overvariant<>anymore, now it is a distinct type;cv::GRunArgis extended with a metadata dictionary;cv::GCaptureSourceis extended to put the meta information to the captured frames;streaming::meta<T>(obj, str)operation which accesses a metadata fieldstrof objectobjand of the given typeT; its return value isGOpaque<T>which can be later used in the graph;backends/common) which implements this genericmeta<>()operation;GExecutor/GStreamingExecutorlevel. This is the most debatable part of the patch -- now asynchronous islands have to manage and post this metadata information for outputs on their own. However, there is a default implementation for the synchronous islands (which covers 100% of our public backends).Sporadic failures in desync* tests
There was an issue with some tests on desync failing in different configurations. The failing check compared number of frames received through the "main" path against the number of frames received through a "desynchronized" path, what in theory shouldn't happen.
The issue occurred due to the main path actually running slower than a desync path on a particular machine or in a particular build configuration. Because of that, a desync path has got its "Stop" message earlier and broadcasted it down to the output queue while the "main" path was still busy. It led to terminating the streaming pipeline earlier that expected and that "counter mismatch" problem occurred because of that.
Patch to opencv_extra has the same branch name.