2018-09-27 02:50:39 +08:00
|
|
|
// This file is part of OpenCV project.
|
|
|
|
// It is subject to the license terms in the LICENSE file found in the top-level directory
|
|
|
|
// of this distribution and at http://opencv.org/license.html.
|
|
|
|
//
|
2020-09-08 01:10:03 +08:00
|
|
|
// Copyright (C) 2018-2020 Intel Corporation
|
2018-09-27 02:50:39 +08:00
|
|
|
|
|
|
|
|
|
|
|
#ifndef OPENCV_GAPI_GMODEL_HPP
|
|
|
|
#define OPENCV_GAPI_GMODEL_HPP
|
|
|
|
|
|
|
|
#include <memory> // shared_ptr
|
|
|
|
#include <unordered_map>
|
|
|
|
#include <functional> // std::function
|
|
|
|
|
|
|
|
#include <ade/graph.hpp>
|
|
|
|
#include <ade/typed_graph.hpp>
|
|
|
|
#include <ade/passes/topological_sort.hpp>
|
|
|
|
|
|
|
|
// /!\ ATTENTION:
|
|
|
|
//
|
|
|
|
// No API includes like GMat, GNode, GCall here!
|
|
|
|
// This part of the system is API-unaware by its design.
|
|
|
|
//
|
|
|
|
|
2019-08-05 22:56:34 +08:00
|
|
|
#include <opencv2/gapi/util/any.hpp>
|
|
|
|
|
2019-06-15 00:27:19 +08:00
|
|
|
#include <opencv2/gapi/garg.hpp>
|
|
|
|
#include <opencv2/gapi/gkernel.hpp>
|
2020-09-08 01:10:03 +08:00
|
|
|
#include <opencv2/gapi/gcommon.hpp>
|
2018-09-27 02:50:39 +08:00
|
|
|
|
|
|
|
#include "compiler/gobjref.hpp"
|
|
|
|
#include "compiler/gislandmodel.hpp"
|
|
|
|
|
|
|
|
namespace cv { namespace gimpl {
|
|
|
|
|
|
|
|
// TODO: Document all metadata types
|
|
|
|
|
|
|
|
struct NodeType
|
|
|
|
{
|
|
|
|
static const char *name() { return "NodeType"; }
|
|
|
|
enum { OP, DATA } t;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Input
|
|
|
|
{
|
|
|
|
static const char *name() { return "Input"; }
|
|
|
|
std::size_t port;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Output
|
|
|
|
{
|
|
|
|
static const char *name() { return "Output"; }
|
|
|
|
std::size_t port;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Op
|
|
|
|
{
|
|
|
|
static const char *name() { return "Op"; }
|
|
|
|
cv::GKernel k;
|
|
|
|
std::vector<GArg> args; // TODO: Introduce a new type for internal args?
|
|
|
|
std::vector<RcDesc> outs; // TODO: Introduce a new type for resource references
|
|
|
|
|
|
|
|
cv::gapi::GBackend backend;
|
2020-10-09 06:12:25 +08:00
|
|
|
cv::util::any params; // Operation specific information
|
2018-09-27 02:50:39 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
struct Data
|
|
|
|
{
|
|
|
|
static const char *name() { return "Data"; }
|
|
|
|
|
|
|
|
// FIXME: This is a _pure_ duplication of RcDesc now! (except storage)
|
|
|
|
GShape shape; // FIXME: Probably to be replaced by GMetaArg?
|
2022-04-06 02:00:32 +08:00
|
|
|
int rc; // rc is unique but local to shape
|
2018-09-27 02:50:39 +08:00
|
|
|
GMetaArg meta;
|
|
|
|
HostCtor ctor; // T-specific helper to deal with unknown types in our code
|
2020-09-08 01:10:03 +08:00
|
|
|
cv::detail::OpaqueKind kind; // FIXME: is needed to store GArray/GOpaque type
|
2018-09-27 02:50:39 +08:00
|
|
|
// FIXME: Why rc+shape+meta is not represented as RcDesc here?
|
|
|
|
|
Merge pull request #17020 from dbudniko:dbudniko/serialization_backend
G-API Serialization routines
* Serialization backend in tests, initial version
* S11N/00: A Great Rename
- "Serialization" is too long and too error-prone to type,
so now it is renamed to "s11n" everywhere;
- Same applies to "SRLZ";
- Tests also renamed to start with 'S11N.*' (easier to run);
- Also updated copyright years in new files to 2020.
* S11N/01: Some basic interface segregation
- Moved some details (low-level functions) out of serialization.hpp;
- Introduced I::IStream and I::OStream interfaces;
- Implemented those via the existing [De]SerializationStream classes;
- Moved all operators to use interfaces instead of classes;
- Moved the htonl/ntohl handling out of operators (to the classes).
The implementation didn't change much, it is a subject to the further
refactoring
* S11N/02: Basic operator reorg, basic tests, vector support
- Reorganized operators on atomic types to follow >>/<< model
(put them closer in the code for the respective types);
- Introduce more operators for basic (scalar) types;
- Drop all vector s11n overloads -- replace with a generic
(template-based) one;
- Introduced a new test suite where low-level s11n functionality
is tested (for the basic types).
* S11N/03: Operators reorganization
- Sorted the Opaque types enum by complexity;
- Reorganized the existing operators for basic types, also ordered by
complexity;
- Organized operators in three groups (Basics, OpenCV, G-API);
- Added a generic serialization for variant<>;
- Reimplemented some of the existing operators (for OpenCV and G-API
data structures);
- Introduced new operators for cv::gimpl data types. These operators
(and so, the data structures) are not yet used in the graph
dump/reconstruction routine, it will be done as a next step.
* S11N/04: The Great Clean-up
- Drop the duplicates of GModel data structures from the
serialization, serialize the GModel data structures themselve
instead (hand-written code replaced with operators).
- Also removed usuned code for printing, etc.
* S11N/05: Internal API Clean-up
- Minimize the serialization API to just Streams and Operators;
- Refactor and fix the graph serialization (deconstruction and
reconstruction) routines, fix data addressing problems there;
- Move the serialization.[ch]pp files to the core G-API library
* S11N/06: Top-level API introduction
- !!!This is likely the most invasive commit in the series!!!
- Introduced a top-level API to serialize and deserialize a GComputation
- Extended the compiler to support both forms of a GComputation:
an expession based and a deserialized one. This has led to changes in
the cv::GComputation::Priv and in its dependent components (even the
transformation tests);
- Had to extend the kernel API (GKernel) with extra information on
operations (mainly `outMeta`) which was only available for expression
based graphs. Now the `outMeta` can be taken from kernels too (and for
the deserialized graphs it is the only way);
- Revisited the internal serialization API, had to expose previously
hidden entities (like `GSerialized`);
- Extended the serialized graph info with new details (object counter,
protocol). Added unordered_map generic serialization for that;
- Reworked the very first pipeline test to be "proper"; GREEN now, the rest
is to be reworked in the next iteration.
* S11N/07: Tests reworked
- Moved the sample pipeline tests w/serialization to
test the public API (`cv::gapi::serialize`, then
followed by `cv::gapi::deserialize<>`). All GREEN.
- As a consequence, dropped the "Serialization" test
backend as no longer necessary.
* S11N/08: Final touches
- Exposed the C++ native data types at Streams level;
- Switched the ByteMemoryIn/OutStreams to store data in `char`
internally (2x less memory for sample pipelines);
- Fixed and refactored Mat dumping to the stream;
- Renamed S11N pipeline tests to their new meaning.
* linux build fix
* fix RcDesc and int uint warnings
* more Linux build fix
* white space and virtual android error fix (attempt)
* more warnings to be fixed
* android warnings fix attempt
* one more attempt for android build fix
* android warnings one more fix
* return back override
* avoid size_t
* static deserialize
* and how do you like this, elon? anonymous namespace to fix android warning.
* static inline
* trying to fix standalone build
* mat dims fix
* fix mat r/w for standalone
Co-authored-by: Dmitry Matveev <dmitry.matveev@intel.com>
2020-06-27 03:41:29 +08:00
|
|
|
enum class Storage: int
|
2018-09-27 02:50:39 +08:00
|
|
|
{
|
|
|
|
INTERNAL, // data object is not listed in GComputation protocol
|
|
|
|
INPUT, // data object is listed in GComputation protocol as Input
|
|
|
|
OUTPUT, // data object is listed in GComputation protocol as Output
|
2019-08-05 22:56:34 +08:00
|
|
|
CONST_VAL, // data object is constant.
|
|
|
|
// Note: CONST is sometimes defined in Win sys headers
|
2018-09-27 02:50:39 +08:00
|
|
|
};
|
|
|
|
Storage storage;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ConstValue
|
|
|
|
{
|
|
|
|
static const char *name() { return "ConstValue"; }
|
|
|
|
GRunArg arg;
|
|
|
|
};
|
|
|
|
|
|
|
|
// This metadata is valid for both DATA and OP kinds of nodes
|
|
|
|
// FIXME: Rename to IslandTag
|
|
|
|
struct Island
|
|
|
|
{
|
|
|
|
static const char *name() { return "Island"; }
|
|
|
|
std::string island; // can be set by user, otherwise is set by fusion
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Protocol
|
|
|
|
{
|
|
|
|
static const char *name() { return "Protocol"; }
|
|
|
|
// TODO: Replace the whole thing with a "Protocol" object
|
|
|
|
std::vector<RcDesc> inputs;
|
|
|
|
std::vector<RcDesc> outputs;
|
|
|
|
|
|
|
|
std::vector<ade::NodeHandle> in_nhs;
|
|
|
|
std::vector<ade::NodeHandle> out_nhs;
|
|
|
|
};
|
|
|
|
|
2019-12-04 00:14:13 +08:00
|
|
|
// The original metadata the graph has been compiled for.
|
|
|
|
// - For regular GCompiled, this information always present and
|
|
|
|
// is NOT updated on reshape()
|
|
|
|
// - For GStreamingCompiled, this information may be missing.
|
|
|
|
// It means that compileStreaming() was called without meta.
|
|
|
|
struct OriginalInputMeta
|
|
|
|
{
|
|
|
|
static const char *name() { return "OriginalInputMeta"; }
|
|
|
|
GMetaArgs inputMeta;
|
|
|
|
};
|
|
|
|
|
2018-09-27 02:50:39 +08:00
|
|
|
struct OutputMeta
|
|
|
|
{
|
|
|
|
static const char *name() { return "OutputMeta"; }
|
|
|
|
GMetaArgs outMeta;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Journal
|
|
|
|
{
|
|
|
|
static const char *name() { return "Journal"; }
|
|
|
|
std::vector<std::string> messages;
|
|
|
|
};
|
|
|
|
|
|
|
|
// Unique data object counter (per-type)
|
|
|
|
class DataObjectCounter
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
static const char* name() { return "DataObjectCounter"; }
|
|
|
|
int GetNewId(GShape shape) { return m_next_data_id[shape]++; }
|
Merge pull request #17020 from dbudniko:dbudniko/serialization_backend
G-API Serialization routines
* Serialization backend in tests, initial version
* S11N/00: A Great Rename
- "Serialization" is too long and too error-prone to type,
so now it is renamed to "s11n" everywhere;
- Same applies to "SRLZ";
- Tests also renamed to start with 'S11N.*' (easier to run);
- Also updated copyright years in new files to 2020.
* S11N/01: Some basic interface segregation
- Moved some details (low-level functions) out of serialization.hpp;
- Introduced I::IStream and I::OStream interfaces;
- Implemented those via the existing [De]SerializationStream classes;
- Moved all operators to use interfaces instead of classes;
- Moved the htonl/ntohl handling out of operators (to the classes).
The implementation didn't change much, it is a subject to the further
refactoring
* S11N/02: Basic operator reorg, basic tests, vector support
- Reorganized operators on atomic types to follow >>/<< model
(put them closer in the code for the respective types);
- Introduce more operators for basic (scalar) types;
- Drop all vector s11n overloads -- replace with a generic
(template-based) one;
- Introduced a new test suite where low-level s11n functionality
is tested (for the basic types).
* S11N/03: Operators reorganization
- Sorted the Opaque types enum by complexity;
- Reorganized the existing operators for basic types, also ordered by
complexity;
- Organized operators in three groups (Basics, OpenCV, G-API);
- Added a generic serialization for variant<>;
- Reimplemented some of the existing operators (for OpenCV and G-API
data structures);
- Introduced new operators for cv::gimpl data types. These operators
(and so, the data structures) are not yet used in the graph
dump/reconstruction routine, it will be done as a next step.
* S11N/04: The Great Clean-up
- Drop the duplicates of GModel data structures from the
serialization, serialize the GModel data structures themselve
instead (hand-written code replaced with operators).
- Also removed usuned code for printing, etc.
* S11N/05: Internal API Clean-up
- Minimize the serialization API to just Streams and Operators;
- Refactor and fix the graph serialization (deconstruction and
reconstruction) routines, fix data addressing problems there;
- Move the serialization.[ch]pp files to the core G-API library
* S11N/06: Top-level API introduction
- !!!This is likely the most invasive commit in the series!!!
- Introduced a top-level API to serialize and deserialize a GComputation
- Extended the compiler to support both forms of a GComputation:
an expession based and a deserialized one. This has led to changes in
the cv::GComputation::Priv and in its dependent components (even the
transformation tests);
- Had to extend the kernel API (GKernel) with extra information on
operations (mainly `outMeta`) which was only available for expression
based graphs. Now the `outMeta` can be taken from kernels too (and for
the deserialized graphs it is the only way);
- Revisited the internal serialization API, had to expose previously
hidden entities (like `GSerialized`);
- Extended the serialized graph info with new details (object counter,
protocol). Added unordered_map generic serialization for that;
- Reworked the very first pipeline test to be "proper"; GREEN now, the rest
is to be reworked in the next iteration.
* S11N/07: Tests reworked
- Moved the sample pipeline tests w/serialization to
test the public API (`cv::gapi::serialize`, then
followed by `cv::gapi::deserialize<>`). All GREEN.
- As a consequence, dropped the "Serialization" test
backend as no longer necessary.
* S11N/08: Final touches
- Exposed the C++ native data types at Streams level;
- Switched the ByteMemoryIn/OutStreams to store data in `char`
internally (2x less memory for sample pipelines);
- Fixed and refactored Mat dumping to the stream;
- Renamed S11N pipeline tests to their new meaning.
* linux build fix
* fix RcDesc and int uint warnings
* more Linux build fix
* white space and virtual android error fix (attempt)
* more warnings to be fixed
* android warnings fix attempt
* one more attempt for android build fix
* android warnings one more fix
* return back override
* avoid size_t
* static deserialize
* and how do you like this, elon? anonymous namespace to fix android warning.
* static inline
* trying to fix standalone build
* mat dims fix
* fix mat r/w for standalone
Co-authored-by: Dmitry Matveev <dmitry.matveev@intel.com>
2020-06-27 03:41:29 +08:00
|
|
|
|
|
|
|
// NB: private!!! but used in the serialization
|
|
|
|
// couldn't get the `friend` stuff working correctly -- DM
|
2018-09-27 02:50:39 +08:00
|
|
|
std::unordered_map<cv::GShape, int> m_next_data_id;
|
|
|
|
};
|
|
|
|
|
|
|
|
// A projected graph of Islands (generated from graph of Operations)
|
|
|
|
struct IslandModel
|
|
|
|
{
|
|
|
|
static const char* name() { return "IslandModel"; }
|
|
|
|
std::shared_ptr<ade::Graph> model;
|
|
|
|
};
|
|
|
|
|
|
|
|
// List of backends selected for current graph execution
|
|
|
|
struct ActiveBackends
|
|
|
|
{
|
|
|
|
static const char *name() { return "ActiveBackends"; }
|
|
|
|
std::unordered_set<cv::gapi::GBackend> backends;
|
|
|
|
};
|
|
|
|
|
Merge pull request #15216 from dmatveev:dm/ng-0010-g-api-streaming-api
* G-API-NG/Streaming: Introduced a Streaming API
Now a GComputation can be compiled in a special "streaming" way
and then "played" on a video stream.
Currently only VideoCapture is supported as an input source.
* G-API-NG/Streaming: added threading & real streaming
* G-API-NG/Streaming: Added tests & docs on Copy kernel
- Added very simple pipeline tests, not all data types are covered yet
(in fact, only GMat is tested now);
- Started testing non-OCV backends in the streaming mode;
- Added required fixes to Fluid backend, likely it works OK now;
- Added required fixes to OCL backend, and now it is likely broken
- Also added a UMat-based (OCL) version of Copy kernel
* G-API-NG/Streaming: Added own concurrent queue class
- Used only if TBB is not available
* G-API-NG/Streaming: Fixing various issues
- Added missing header to CMakeLists.txt
- Fixed various CI issues and warnings
* G-API-NG/Streaming: Fixed a compile-time GScalar queue deadlock
- GStreamingExecutor blindly created island's input queues for
compile-time (value-initialized) GScalars which didn't have any
producers, making island actor threads wait there forever
* G-API-NG/Streaming: Dropped own version of Copy kernel
One was added into master already
* G-API-NG/Streaming: Addressed GArray<T> review comments
- Added tests on mov()
- Removed unnecessary changes in garray.hpp
* G-API-NG/Streaming: Added Doxygen comments to new public APIs
Also fixed some other comments in the code
* G-API-NG/Streaming: Removed debug info, added some comments & renamed vars
* G-API-NG/Streaming: Fixed own-vs-cv abstraction leak
- Now every island is triggered with own:: (instead of cv::)
data objects as inputs;
- Changes in Fluid backend required to support cv::Mat/Scalar were
reverted;
* G-API-NG/Streaming: use holds_alternative<> instead of index/index_of test
- Also fixed regression test comments
- Also added metadata check comments for GStreamingCompiled
* G-API-NG/Streaming: Made start()/stop() more robust
- Fixed various possible deadlocks
- Unified the shutdown code
- Added more tests covering different corner cases on start/stop
* G-API-NG/Streaming: Finally fixed Windows crashes
In fact the problem hasn't been Windows-only.
Island thread popped data from queues without preserving the Cmd
objects and without taking the ownership over data acquired so when
islands started to process the data, this data may be already freed.
Linux version worked only by occasion.
* G-API-NG/Streaming: Fixed (I hope so) Windows warnings
* G-API-NG/Streaming: fixed typos in internal comments
- Also added some more explanation on Streaming/OpenCL status
* G-API-NG/Streaming: Added more unit tests on streaming
- Various start()/stop()/setSource() call flow combinations
* G-API-NG/Streaming: Added tests on own concurrent bounded queue
* G-API-NG/Streaming: Added more tests on various data types, + more
- Vector/Scalar passed as input;
- Vector/Scalar passed in-between islands;
- Some more assertions;
- Also fixed a deadlock problem when inputs are mixed (1 constant, 1 stream)
* G-API-NG/Streaming: Added tests on output data types handling
- Vector
- Scalar
* G-API-NG/Streaming: Fixed test issues with IE + Windows warnings
* G-API-NG/Streaming: Decoupled G-API from videoio
- Now the core G-API doesn't use a cv::VideoCapture directly,
it comes in via an abstract interface;
- Polished a little bit the setSource()/start()/stop() semantics,
now setSource() is mandatory before ANY call to start().
* G-API-NG/Streaming: Fix STANDALONE build (errors brought by render)
2019-10-19 00:29:58 +08:00
|
|
|
// This is a graph-global flag indicating this graph is compiled for
|
|
|
|
// the streaming case. Streaming-neutral passes (i.e. nearly all of
|
|
|
|
// them) can ignore this flag safely.
|
|
|
|
//
|
|
|
|
// FIXME: Probably a better design can be suggested.
|
|
|
|
struct Streaming
|
|
|
|
{
|
|
|
|
static const char *name() { return "StreamingFlag"; }
|
|
|
|
};
|
|
|
|
|
Merge pull request #17020 from dbudniko:dbudniko/serialization_backend
G-API Serialization routines
* Serialization backend in tests, initial version
* S11N/00: A Great Rename
- "Serialization" is too long and too error-prone to type,
so now it is renamed to "s11n" everywhere;
- Same applies to "SRLZ";
- Tests also renamed to start with 'S11N.*' (easier to run);
- Also updated copyright years in new files to 2020.
* S11N/01: Some basic interface segregation
- Moved some details (low-level functions) out of serialization.hpp;
- Introduced I::IStream and I::OStream interfaces;
- Implemented those via the existing [De]SerializationStream classes;
- Moved all operators to use interfaces instead of classes;
- Moved the htonl/ntohl handling out of operators (to the classes).
The implementation didn't change much, it is a subject to the further
refactoring
* S11N/02: Basic operator reorg, basic tests, vector support
- Reorganized operators on atomic types to follow >>/<< model
(put them closer in the code for the respective types);
- Introduce more operators for basic (scalar) types;
- Drop all vector s11n overloads -- replace with a generic
(template-based) one;
- Introduced a new test suite where low-level s11n functionality
is tested (for the basic types).
* S11N/03: Operators reorganization
- Sorted the Opaque types enum by complexity;
- Reorganized the existing operators for basic types, also ordered by
complexity;
- Organized operators in three groups (Basics, OpenCV, G-API);
- Added a generic serialization for variant<>;
- Reimplemented some of the existing operators (for OpenCV and G-API
data structures);
- Introduced new operators for cv::gimpl data types. These operators
(and so, the data structures) are not yet used in the graph
dump/reconstruction routine, it will be done as a next step.
* S11N/04: The Great Clean-up
- Drop the duplicates of GModel data structures from the
serialization, serialize the GModel data structures themselve
instead (hand-written code replaced with operators).
- Also removed usuned code for printing, etc.
* S11N/05: Internal API Clean-up
- Minimize the serialization API to just Streams and Operators;
- Refactor and fix the graph serialization (deconstruction and
reconstruction) routines, fix data addressing problems there;
- Move the serialization.[ch]pp files to the core G-API library
* S11N/06: Top-level API introduction
- !!!This is likely the most invasive commit in the series!!!
- Introduced a top-level API to serialize and deserialize a GComputation
- Extended the compiler to support both forms of a GComputation:
an expession based and a deserialized one. This has led to changes in
the cv::GComputation::Priv and in its dependent components (even the
transformation tests);
- Had to extend the kernel API (GKernel) with extra information on
operations (mainly `outMeta`) which was only available for expression
based graphs. Now the `outMeta` can be taken from kernels too (and for
the deserialized graphs it is the only way);
- Revisited the internal serialization API, had to expose previously
hidden entities (like `GSerialized`);
- Extended the serialized graph info with new details (object counter,
protocol). Added unordered_map generic serialization for that;
- Reworked the very first pipeline test to be "proper"; GREEN now, the rest
is to be reworked in the next iteration.
* S11N/07: Tests reworked
- Moved the sample pipeline tests w/serialization to
test the public API (`cv::gapi::serialize`, then
followed by `cv::gapi::deserialize<>`). All GREEN.
- As a consequence, dropped the "Serialization" test
backend as no longer necessary.
* S11N/08: Final touches
- Exposed the C++ native data types at Streams level;
- Switched the ByteMemoryIn/OutStreams to store data in `char`
internally (2x less memory for sample pipelines);
- Fixed and refactored Mat dumping to the stream;
- Renamed S11N pipeline tests to their new meaning.
* linux build fix
* fix RcDesc and int uint warnings
* more Linux build fix
* white space and virtual android error fix (attempt)
* more warnings to be fixed
* android warnings fix attempt
* one more attempt for android build fix
* android warnings one more fix
* return back override
* avoid size_t
* static deserialize
* and how do you like this, elon? anonymous namespace to fix android warning.
* static inline
* trying to fix standalone build
* mat dims fix
* fix mat r/w for standalone
Co-authored-by: Dmitry Matveev <dmitry.matveev@intel.com>
2020-06-27 03:41:29 +08:00
|
|
|
|
|
|
|
// This is a graph-global flag indicating this graph is compiled
|
|
|
|
// after the deserialization. Some bits of information may be
|
|
|
|
// unavailable (mainly callbacks) so let sensitive passes obtain
|
|
|
|
// the required information in their special way.
|
|
|
|
//
|
|
|
|
// FIXME: Probably a better design can be suggested.
|
|
|
|
struct Deserialized
|
|
|
|
{
|
|
|
|
static const char *name() { return "DeserializedFlag"; }
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2019-08-05 22:56:34 +08:00
|
|
|
// Backend-specific inference parameters for a neural network.
|
|
|
|
// Since these parameters are set on compilation stage (not
|
|
|
|
// on a construction stage), these parameters are bound lately
|
|
|
|
// to the operation node.
|
|
|
|
// NB: These parameters are not included into GModel by default
|
|
|
|
// since it is not used regularly by all parties.
|
|
|
|
struct NetworkParams
|
|
|
|
{
|
|
|
|
static const char *name() { return "NetworkParams"; }
|
|
|
|
cv::util::any opaque;
|
|
|
|
};
|
|
|
|
|
|
|
|
// This is a custom metadata handling operator.
|
|
|
|
// Sometimes outMeta() can't be bound to input parameters only
|
|
|
|
// so several backends (today -- mainly inference) may find this useful.
|
|
|
|
// If provided, the meta inference pass uses this function instead of
|
|
|
|
// OP.k.outMeta.
|
|
|
|
struct CustomMetaFunction
|
|
|
|
{
|
|
|
|
static const char *name() { return "CustomMetaFunction"; }
|
|
|
|
using CM = std::function< cv::GMetaArgs( const ade::Graph &,
|
|
|
|
const ade::NodeHandle &,
|
|
|
|
const cv::GMetaArgs &,
|
|
|
|
const cv::GArgs &)>;
|
|
|
|
CM customOutMeta;
|
|
|
|
};
|
|
|
|
|
2020-03-18 07:38:24 +08:00
|
|
|
// This is a general flag indicating that this GModel has intrinsics.
|
|
|
|
// In the beginning of the compilation, it is a quick check to
|
|
|
|
// indicate there are intrinsics.
|
|
|
|
//
|
|
|
|
// In the end of the compilation, having this flag is fatal -- all
|
|
|
|
// intrinsics must be resolved.
|
|
|
|
struct HasIntrinsics
|
|
|
|
{
|
|
|
|
static const char *name() { return "HasIntrinsicsFlag"; }
|
|
|
|
};
|
|
|
|
|
|
|
|
// This is a special tag for both DATA and OP nodes indicating
|
|
|
|
// which desynchronized path this node belongs to.
|
|
|
|
// This tag is set by a special complex pass intrinDesync/accept.
|
|
|
|
struct DesyncPath
|
|
|
|
{
|
|
|
|
static const char *name() { return "DesynchronizedPath"; }
|
|
|
|
|
|
|
|
// A zero-based index of the desynchronized path in the graph.
|
|
|
|
// Set by intrinDesync() compiler pass
|
|
|
|
int index;
|
|
|
|
};
|
|
|
|
|
|
|
|
// This is a special tag for graph Edges indicating that this
|
|
|
|
// particular edge starts a desynchronized path in the graph.
|
|
|
|
// At the execution stage, the data coming "through" these edges
|
|
|
|
// (virtually, of course, since our GModel edges never transfer the
|
|
|
|
// actual data, they just represent these transfers) is desynchronized
|
|
|
|
// from the rest of the pipeline, i.e. may be "lost" (stay unconsumed
|
|
|
|
// and then overwritten with some new data when streaming).
|
|
|
|
struct DesyncEdge
|
|
|
|
{
|
|
|
|
static const char *name() { return "DesynchronizedEdge"; }
|
|
|
|
|
|
|
|
// A zero-based index of the desynchronized path in the graph.
|
|
|
|
// Set by intrinDesync/apply() compiler pass
|
|
|
|
int index;
|
|
|
|
};
|
|
|
|
|
|
|
|
// This flag marks the island graph as "desynchronized"
|
|
|
|
struct Desynchronized
|
|
|
|
{
|
|
|
|
static const char *name() { return "Desynchronized"; }
|
|
|
|
};
|
|
|
|
|
|
|
|
// Reference to compile args of the computation
|
|
|
|
struct CompileArgs
|
|
|
|
{
|
|
|
|
static const char *name() { return "CompileArgs"; }
|
|
|
|
GCompileArgs args;
|
|
|
|
};
|
|
|
|
|
2018-09-27 02:50:39 +08:00
|
|
|
namespace GModel
|
|
|
|
{
|
|
|
|
using Graph = ade::TypedGraph
|
|
|
|
< NodeType
|
|
|
|
, Input
|
|
|
|
, Output
|
|
|
|
, Op
|
|
|
|
, Data
|
|
|
|
, ConstValue
|
|
|
|
, Island
|
|
|
|
, Protocol
|
2019-12-04 00:14:13 +08:00
|
|
|
, OriginalInputMeta
|
2018-09-27 02:50:39 +08:00
|
|
|
, OutputMeta
|
|
|
|
, Journal
|
|
|
|
, ade::passes::TopologicalSortData
|
|
|
|
, DataObjectCounter
|
|
|
|
, IslandModel
|
|
|
|
, ActiveBackends
|
2019-08-05 22:56:34 +08:00
|
|
|
, CustomMetaFunction
|
Merge pull request #15216 from dmatveev:dm/ng-0010-g-api-streaming-api
* G-API-NG/Streaming: Introduced a Streaming API
Now a GComputation can be compiled in a special "streaming" way
and then "played" on a video stream.
Currently only VideoCapture is supported as an input source.
* G-API-NG/Streaming: added threading & real streaming
* G-API-NG/Streaming: Added tests & docs on Copy kernel
- Added very simple pipeline tests, not all data types are covered yet
(in fact, only GMat is tested now);
- Started testing non-OCV backends in the streaming mode;
- Added required fixes to Fluid backend, likely it works OK now;
- Added required fixes to OCL backend, and now it is likely broken
- Also added a UMat-based (OCL) version of Copy kernel
* G-API-NG/Streaming: Added own concurrent queue class
- Used only if TBB is not available
* G-API-NG/Streaming: Fixing various issues
- Added missing header to CMakeLists.txt
- Fixed various CI issues and warnings
* G-API-NG/Streaming: Fixed a compile-time GScalar queue deadlock
- GStreamingExecutor blindly created island's input queues for
compile-time (value-initialized) GScalars which didn't have any
producers, making island actor threads wait there forever
* G-API-NG/Streaming: Dropped own version of Copy kernel
One was added into master already
* G-API-NG/Streaming: Addressed GArray<T> review comments
- Added tests on mov()
- Removed unnecessary changes in garray.hpp
* G-API-NG/Streaming: Added Doxygen comments to new public APIs
Also fixed some other comments in the code
* G-API-NG/Streaming: Removed debug info, added some comments & renamed vars
* G-API-NG/Streaming: Fixed own-vs-cv abstraction leak
- Now every island is triggered with own:: (instead of cv::)
data objects as inputs;
- Changes in Fluid backend required to support cv::Mat/Scalar were
reverted;
* G-API-NG/Streaming: use holds_alternative<> instead of index/index_of test
- Also fixed regression test comments
- Also added metadata check comments for GStreamingCompiled
* G-API-NG/Streaming: Made start()/stop() more robust
- Fixed various possible deadlocks
- Unified the shutdown code
- Added more tests covering different corner cases on start/stop
* G-API-NG/Streaming: Finally fixed Windows crashes
In fact the problem hasn't been Windows-only.
Island thread popped data from queues without preserving the Cmd
objects and without taking the ownership over data acquired so when
islands started to process the data, this data may be already freed.
Linux version worked only by occasion.
* G-API-NG/Streaming: Fixed (I hope so) Windows warnings
* G-API-NG/Streaming: fixed typos in internal comments
- Also added some more explanation on Streaming/OpenCL status
* G-API-NG/Streaming: Added more unit tests on streaming
- Various start()/stop()/setSource() call flow combinations
* G-API-NG/Streaming: Added tests on own concurrent bounded queue
* G-API-NG/Streaming: Added more tests on various data types, + more
- Vector/Scalar passed as input;
- Vector/Scalar passed in-between islands;
- Some more assertions;
- Also fixed a deadlock problem when inputs are mixed (1 constant, 1 stream)
* G-API-NG/Streaming: Added tests on output data types handling
- Vector
- Scalar
* G-API-NG/Streaming: Fixed test issues with IE + Windows warnings
* G-API-NG/Streaming: Decoupled G-API from videoio
- Now the core G-API doesn't use a cv::VideoCapture directly,
it comes in via an abstract interface;
- Polished a little bit the setSource()/start()/stop() semantics,
now setSource() is mandatory before ANY call to start().
* G-API-NG/Streaming: Fix STANDALONE build (errors brought by render)
2019-10-19 00:29:58 +08:00
|
|
|
, Streaming
|
Merge pull request #17020 from dbudniko:dbudniko/serialization_backend
G-API Serialization routines
* Serialization backend in tests, initial version
* S11N/00: A Great Rename
- "Serialization" is too long and too error-prone to type,
so now it is renamed to "s11n" everywhere;
- Same applies to "SRLZ";
- Tests also renamed to start with 'S11N.*' (easier to run);
- Also updated copyright years in new files to 2020.
* S11N/01: Some basic interface segregation
- Moved some details (low-level functions) out of serialization.hpp;
- Introduced I::IStream and I::OStream interfaces;
- Implemented those via the existing [De]SerializationStream classes;
- Moved all operators to use interfaces instead of classes;
- Moved the htonl/ntohl handling out of operators (to the classes).
The implementation didn't change much, it is a subject to the further
refactoring
* S11N/02: Basic operator reorg, basic tests, vector support
- Reorganized operators on atomic types to follow >>/<< model
(put them closer in the code for the respective types);
- Introduce more operators for basic (scalar) types;
- Drop all vector s11n overloads -- replace with a generic
(template-based) one;
- Introduced a new test suite where low-level s11n functionality
is tested (for the basic types).
* S11N/03: Operators reorganization
- Sorted the Opaque types enum by complexity;
- Reorganized the existing operators for basic types, also ordered by
complexity;
- Organized operators in three groups (Basics, OpenCV, G-API);
- Added a generic serialization for variant<>;
- Reimplemented some of the existing operators (for OpenCV and G-API
data structures);
- Introduced new operators for cv::gimpl data types. These operators
(and so, the data structures) are not yet used in the graph
dump/reconstruction routine, it will be done as a next step.
* S11N/04: The Great Clean-up
- Drop the duplicates of GModel data structures from the
serialization, serialize the GModel data structures themselve
instead (hand-written code replaced with operators).
- Also removed usuned code for printing, etc.
* S11N/05: Internal API Clean-up
- Minimize the serialization API to just Streams and Operators;
- Refactor and fix the graph serialization (deconstruction and
reconstruction) routines, fix data addressing problems there;
- Move the serialization.[ch]pp files to the core G-API library
* S11N/06: Top-level API introduction
- !!!This is likely the most invasive commit in the series!!!
- Introduced a top-level API to serialize and deserialize a GComputation
- Extended the compiler to support both forms of a GComputation:
an expession based and a deserialized one. This has led to changes in
the cv::GComputation::Priv and in its dependent components (even the
transformation tests);
- Had to extend the kernel API (GKernel) with extra information on
operations (mainly `outMeta`) which was only available for expression
based graphs. Now the `outMeta` can be taken from kernels too (and for
the deserialized graphs it is the only way);
- Revisited the internal serialization API, had to expose previously
hidden entities (like `GSerialized`);
- Extended the serialized graph info with new details (object counter,
protocol). Added unordered_map generic serialization for that;
- Reworked the very first pipeline test to be "proper"; GREEN now, the rest
is to be reworked in the next iteration.
* S11N/07: Tests reworked
- Moved the sample pipeline tests w/serialization to
test the public API (`cv::gapi::serialize`, then
followed by `cv::gapi::deserialize<>`). All GREEN.
- As a consequence, dropped the "Serialization" test
backend as no longer necessary.
* S11N/08: Final touches
- Exposed the C++ native data types at Streams level;
- Switched the ByteMemoryIn/OutStreams to store data in `char`
internally (2x less memory for sample pipelines);
- Fixed and refactored Mat dumping to the stream;
- Renamed S11N pipeline tests to their new meaning.
* linux build fix
* fix RcDesc and int uint warnings
* more Linux build fix
* white space and virtual android error fix (attempt)
* more warnings to be fixed
* android warnings fix attempt
* one more attempt for android build fix
* android warnings one more fix
* return back override
* avoid size_t
* static deserialize
* and how do you like this, elon? anonymous namespace to fix android warning.
* static inline
* trying to fix standalone build
* mat dims fix
* fix mat r/w for standalone
Co-authored-by: Dmitry Matveev <dmitry.matveev@intel.com>
2020-06-27 03:41:29 +08:00
|
|
|
, Deserialized
|
2020-03-18 07:38:24 +08:00
|
|
|
, HasIntrinsics
|
|
|
|
, DesyncPath
|
|
|
|
, DesyncEdge
|
|
|
|
, Desynchronized
|
|
|
|
, CompileArgs
|
2018-09-27 02:50:39 +08:00
|
|
|
>;
|
|
|
|
|
|
|
|
// FIXME: How to define it based on GModel???
|
|
|
|
using ConstGraph = ade::ConstTypedGraph
|
|
|
|
< NodeType
|
|
|
|
, Input
|
|
|
|
, Output
|
|
|
|
, Op
|
|
|
|
, Data
|
|
|
|
, ConstValue
|
|
|
|
, Island
|
|
|
|
, Protocol
|
2019-12-04 00:14:13 +08:00
|
|
|
, OriginalInputMeta
|
2018-09-27 02:50:39 +08:00
|
|
|
, OutputMeta
|
|
|
|
, Journal
|
|
|
|
, ade::passes::TopologicalSortData
|
|
|
|
, DataObjectCounter
|
|
|
|
, IslandModel
|
|
|
|
, ActiveBackends
|
2019-08-05 22:56:34 +08:00
|
|
|
, CustomMetaFunction
|
Merge pull request #15216 from dmatveev:dm/ng-0010-g-api-streaming-api
* G-API-NG/Streaming: Introduced a Streaming API
Now a GComputation can be compiled in a special "streaming" way
and then "played" on a video stream.
Currently only VideoCapture is supported as an input source.
* G-API-NG/Streaming: added threading & real streaming
* G-API-NG/Streaming: Added tests & docs on Copy kernel
- Added very simple pipeline tests, not all data types are covered yet
(in fact, only GMat is tested now);
- Started testing non-OCV backends in the streaming mode;
- Added required fixes to Fluid backend, likely it works OK now;
- Added required fixes to OCL backend, and now it is likely broken
- Also added a UMat-based (OCL) version of Copy kernel
* G-API-NG/Streaming: Added own concurrent queue class
- Used only if TBB is not available
* G-API-NG/Streaming: Fixing various issues
- Added missing header to CMakeLists.txt
- Fixed various CI issues and warnings
* G-API-NG/Streaming: Fixed a compile-time GScalar queue deadlock
- GStreamingExecutor blindly created island's input queues for
compile-time (value-initialized) GScalars which didn't have any
producers, making island actor threads wait there forever
* G-API-NG/Streaming: Dropped own version of Copy kernel
One was added into master already
* G-API-NG/Streaming: Addressed GArray<T> review comments
- Added tests on mov()
- Removed unnecessary changes in garray.hpp
* G-API-NG/Streaming: Added Doxygen comments to new public APIs
Also fixed some other comments in the code
* G-API-NG/Streaming: Removed debug info, added some comments & renamed vars
* G-API-NG/Streaming: Fixed own-vs-cv abstraction leak
- Now every island is triggered with own:: (instead of cv::)
data objects as inputs;
- Changes in Fluid backend required to support cv::Mat/Scalar were
reverted;
* G-API-NG/Streaming: use holds_alternative<> instead of index/index_of test
- Also fixed regression test comments
- Also added metadata check comments for GStreamingCompiled
* G-API-NG/Streaming: Made start()/stop() more robust
- Fixed various possible deadlocks
- Unified the shutdown code
- Added more tests covering different corner cases on start/stop
* G-API-NG/Streaming: Finally fixed Windows crashes
In fact the problem hasn't been Windows-only.
Island thread popped data from queues without preserving the Cmd
objects and without taking the ownership over data acquired so when
islands started to process the data, this data may be already freed.
Linux version worked only by occasion.
* G-API-NG/Streaming: Fixed (I hope so) Windows warnings
* G-API-NG/Streaming: fixed typos in internal comments
- Also added some more explanation on Streaming/OpenCL status
* G-API-NG/Streaming: Added more unit tests on streaming
- Various start()/stop()/setSource() call flow combinations
* G-API-NG/Streaming: Added tests on own concurrent bounded queue
* G-API-NG/Streaming: Added more tests on various data types, + more
- Vector/Scalar passed as input;
- Vector/Scalar passed in-between islands;
- Some more assertions;
- Also fixed a deadlock problem when inputs are mixed (1 constant, 1 stream)
* G-API-NG/Streaming: Added tests on output data types handling
- Vector
- Scalar
* G-API-NG/Streaming: Fixed test issues with IE + Windows warnings
* G-API-NG/Streaming: Decoupled G-API from videoio
- Now the core G-API doesn't use a cv::VideoCapture directly,
it comes in via an abstract interface;
- Polished a little bit the setSource()/start()/stop() semantics,
now setSource() is mandatory before ANY call to start().
* G-API-NG/Streaming: Fix STANDALONE build (errors brought by render)
2019-10-19 00:29:58 +08:00
|
|
|
, Streaming
|
Merge pull request #17020 from dbudniko:dbudniko/serialization_backend
G-API Serialization routines
* Serialization backend in tests, initial version
* S11N/00: A Great Rename
- "Serialization" is too long and too error-prone to type,
so now it is renamed to "s11n" everywhere;
- Same applies to "SRLZ";
- Tests also renamed to start with 'S11N.*' (easier to run);
- Also updated copyright years in new files to 2020.
* S11N/01: Some basic interface segregation
- Moved some details (low-level functions) out of serialization.hpp;
- Introduced I::IStream and I::OStream interfaces;
- Implemented those via the existing [De]SerializationStream classes;
- Moved all operators to use interfaces instead of classes;
- Moved the htonl/ntohl handling out of operators (to the classes).
The implementation didn't change much, it is a subject to the further
refactoring
* S11N/02: Basic operator reorg, basic tests, vector support
- Reorganized operators on atomic types to follow >>/<< model
(put them closer in the code for the respective types);
- Introduce more operators for basic (scalar) types;
- Drop all vector s11n overloads -- replace with a generic
(template-based) one;
- Introduced a new test suite where low-level s11n functionality
is tested (for the basic types).
* S11N/03: Operators reorganization
- Sorted the Opaque types enum by complexity;
- Reorganized the existing operators for basic types, also ordered by
complexity;
- Organized operators in three groups (Basics, OpenCV, G-API);
- Added a generic serialization for variant<>;
- Reimplemented some of the existing operators (for OpenCV and G-API
data structures);
- Introduced new operators for cv::gimpl data types. These operators
(and so, the data structures) are not yet used in the graph
dump/reconstruction routine, it will be done as a next step.
* S11N/04: The Great Clean-up
- Drop the duplicates of GModel data structures from the
serialization, serialize the GModel data structures themselve
instead (hand-written code replaced with operators).
- Also removed usuned code for printing, etc.
* S11N/05: Internal API Clean-up
- Minimize the serialization API to just Streams and Operators;
- Refactor and fix the graph serialization (deconstruction and
reconstruction) routines, fix data addressing problems there;
- Move the serialization.[ch]pp files to the core G-API library
* S11N/06: Top-level API introduction
- !!!This is likely the most invasive commit in the series!!!
- Introduced a top-level API to serialize and deserialize a GComputation
- Extended the compiler to support both forms of a GComputation:
an expession based and a deserialized one. This has led to changes in
the cv::GComputation::Priv and in its dependent components (even the
transformation tests);
- Had to extend the kernel API (GKernel) with extra information on
operations (mainly `outMeta`) which was only available for expression
based graphs. Now the `outMeta` can be taken from kernels too (and for
the deserialized graphs it is the only way);
- Revisited the internal serialization API, had to expose previously
hidden entities (like `GSerialized`);
- Extended the serialized graph info with new details (object counter,
protocol). Added unordered_map generic serialization for that;
- Reworked the very first pipeline test to be "proper"; GREEN now, the rest
is to be reworked in the next iteration.
* S11N/07: Tests reworked
- Moved the sample pipeline tests w/serialization to
test the public API (`cv::gapi::serialize`, then
followed by `cv::gapi::deserialize<>`). All GREEN.
- As a consequence, dropped the "Serialization" test
backend as no longer necessary.
* S11N/08: Final touches
- Exposed the C++ native data types at Streams level;
- Switched the ByteMemoryIn/OutStreams to store data in `char`
internally (2x less memory for sample pipelines);
- Fixed and refactored Mat dumping to the stream;
- Renamed S11N pipeline tests to their new meaning.
* linux build fix
* fix RcDesc and int uint warnings
* more Linux build fix
* white space and virtual android error fix (attempt)
* more warnings to be fixed
* android warnings fix attempt
* one more attempt for android build fix
* android warnings one more fix
* return back override
* avoid size_t
* static deserialize
* and how do you like this, elon? anonymous namespace to fix android warning.
* static inline
* trying to fix standalone build
* mat dims fix
* fix mat r/w for standalone
Co-authored-by: Dmitry Matveev <dmitry.matveev@intel.com>
2020-06-27 03:41:29 +08:00
|
|
|
, Deserialized
|
2020-03-18 07:38:24 +08:00
|
|
|
, HasIntrinsics
|
|
|
|
, DesyncPath
|
|
|
|
, DesyncEdge
|
|
|
|
, Desynchronized
|
|
|
|
, CompileArgs
|
2018-09-27 02:50:39 +08:00
|
|
|
>;
|
|
|
|
|
2019-04-18 02:54:47 +08:00
|
|
|
// FIXME:
|
|
|
|
// Export a single class, not a bunch of functions inside a namespace
|
|
|
|
|
2018-09-27 02:50:39 +08:00
|
|
|
// User should initialize graph before using it
|
|
|
|
// GAPI_EXPORTS for tests
|
|
|
|
GAPI_EXPORTS void init (Graph& g);
|
|
|
|
|
2020-10-09 06:12:25 +08:00
|
|
|
GAPI_EXPORTS ade::NodeHandle mkOpNode(Graph &g,
|
|
|
|
const GKernel &k,
|
|
|
|
const std::vector<GArg>& args,
|
|
|
|
const cv::util::any& params,
|
|
|
|
const std::string &island);
|
2019-10-22 23:57:31 +08:00
|
|
|
// Isn't used by the framework or default backends, required for external backend development
|
|
|
|
GAPI_EXPORTS ade::NodeHandle mkDataNode(Graph &g, const GShape shape);
|
2018-09-27 02:50:39 +08:00
|
|
|
|
|
|
|
// Adds a string message to a node. Any node can be subject of log, messages then
|
|
|
|
// appear in the dumped .dot file.x
|
2019-04-18 02:54:47 +08:00
|
|
|
GAPI_EXPORTS void log(Graph &g, ade::NodeHandle op, std::string &&message, ade::NodeHandle updater = ade::NodeHandle());
|
|
|
|
GAPI_EXPORTS void log(Graph &g, ade::EdgeHandle op, std::string &&message, ade::NodeHandle updater = ade::NodeHandle());
|
2019-08-14 15:03:52 +08:00
|
|
|
// Clears logged messages of a node.
|
|
|
|
GAPI_EXPORTS void log_clear(Graph &g, ade::NodeHandle node);
|
2018-09-27 02:50:39 +08:00
|
|
|
|
2020-03-18 07:38:24 +08:00
|
|
|
GAPI_EXPORTS ade::EdgeHandle linkIn (Graph &g, ade::NodeHandle op, ade::NodeHandle obj, std::size_t in_port);
|
|
|
|
GAPI_EXPORTS ade::EdgeHandle linkOut (Graph &g, ade::NodeHandle op, ade::NodeHandle obj, std::size_t out_port);
|
2018-09-27 02:50:39 +08:00
|
|
|
|
2020-03-18 07:38:24 +08:00
|
|
|
GAPI_EXPORTS std::vector<ade::EdgeHandle> redirectReaders(Graph &g, ade::NodeHandle from, ade::NodeHandle to);
|
|
|
|
GAPI_EXPORTS ade::EdgeHandle redirectWriter (Graph &g, ade::NodeHandle from, ade::NodeHandle to);
|
2018-09-27 02:50:39 +08:00
|
|
|
|
2019-12-10 18:31:43 +08:00
|
|
|
GAPI_EXPORTS std::vector<ade::NodeHandle> orderedInputs (const ConstGraph &g, ade::NodeHandle nh);
|
|
|
|
GAPI_EXPORTS std::vector<ade::NodeHandle> orderedOutputs(const ConstGraph &g, ade::NodeHandle nh);
|
2018-09-27 02:50:39 +08:00
|
|
|
|
|
|
|
// Returns input meta array for given op node
|
|
|
|
// Array is sparse, as metadata for non-gapi input objects is empty
|
|
|
|
// TODO:
|
|
|
|
// Cover with tests!!
|
2019-12-10 18:31:43 +08:00
|
|
|
GAPI_EXPORTS GMetaArgs collectInputMeta(const GModel::ConstGraph &cg, ade::NodeHandle node);
|
|
|
|
GAPI_EXPORTS GMetaArgs collectOutputMeta(const GModel::ConstGraph &cg, ade::NodeHandle node);
|
2018-09-27 02:50:39 +08:00
|
|
|
|
2019-04-18 02:54:47 +08:00
|
|
|
GAPI_EXPORTS ade::EdgeHandle getInEdgeByPort(const GModel::ConstGraph& cg, const ade::NodeHandle& nh, std::size_t in_port);
|
2018-09-27 02:50:39 +08:00
|
|
|
|
|
|
|
// Returns true if the given backend participates in the execution
|
2019-04-18 02:54:47 +08:00
|
|
|
GAPI_EXPORTS bool isActive(const GModel::Graph &cg, const cv::gapi::GBackend &backend);
|
2018-09-27 02:50:39 +08:00
|
|
|
} // namespace GModel
|
|
|
|
|
|
|
|
|
|
|
|
}} // namespace cv::gimpl
|
|
|
|
|
|
|
|
#endif // OPENCV_GAPI_GMODEL_HPP
|