Commit Graph

203 Commits

Author SHA1 Message Date
Ruslan Garnov
e06a497c7c Added format.hpp include to core.hpp 2020-12-16 19:29:06 +03:00
Ruslan Garnov
f7cab121fe
Merge pull request #19112 from rgarnov:rg/generic_copy_kernel
Generic copy kernel

* Moved RMat wrapping of cv::Mats to StreamingInput

* Generalized GCopy kernel

* Generic GCopy kernel: applied review comments
2020-12-16 11:18:08 +00:00
Anatoliy Talamanov
50baf76cc2
Merge pull request #19107 from TolyaTalamanov:at/hotfix-gstreamingbackend
[G-API] GStreamingBackend hotfix

* GStreamingBackend hotfix

* Fix comments to review

* Add strides

* Removew while loop inside actor
2020-12-15 18:05:26 +00:00
Anna Khakimova
46e275dfe4
Merge pull request #18869 from anna-khakimova:ak/kalman
* GAPI: Kalman filter stateful kernel

* Applied comments

* Applied comments. Second iteration

* Add overload without control vector

* Remove structure constructor and dimension fields.

* Add sample as test

* Remove visualization from test-sample + correct doxygen comments

* Applied comments.
2020-12-14 08:56:37 +00:00
Anatoliy Talamanov
8ed0fc6f0c
Merge pull request #19009 from TolyaTalamanov:at/media-frame-copy
[G-API] GStreamingBackend

* Snapshot

* Implement StreamingBackend

* Refactoring

* Refactoring 2

* Clean up

* Add missing functionality to support MediaFrame as output

* Partially address review comments

* Fix build

* Implement reshape for gstreamingbackend and add a test on it

* Address more comments

* Add format.hpp to gapi.hpp

* Fix debug build

* Address review comments

Co-authored-by: Smirnov Alexey <alexey.smirnov@intel.com>
2020-12-11 16:29:34 +00:00
Anatoliy Talamanov
a55150b1bc
Merge pull request #19002 from TolyaTalamanov:at/infer_gframe
[G-API] Support GFrame for infer

* GInfer(GFrame), currently broken

* Fixed (API only)

* Support GFrame in GIEBackend

* Fix comments to review

* Fix comments to review

* Fix doxygen

* Fix building with different IE versions

* Fix warning on MacOS

Co-authored-by: Dmitry Matveev <dmitry.matveev@intel.com>
Co-authored-by: Smirnov Alexey <alexey.smirnov@intel.com>
2020-12-09 14:00:56 +00:00
Orest Chura
f41327df0c
Merge pull request #18969 from OrestChura:oc/fix_notes_returns
[G-API] Multiple return/note fix

* Fix doxygen:
 - multiple return
 - multiple notes

* Addressing comments
 - divide description of split(merge)3/4
2020-12-08 15:44:33 +00:00
Alexander Alekhin
d1b5a78171 build warnings
- GCC 4.8.5 / CentOS 7
2020-12-05 20:08:29 +00:00
Anton Potapov
446f344818 GAPI: fix C++17 compilation errors in GNetPackage (fixes #17385)
- explicitly declared default constructor
- made initilizer_list  constructor to accept the list by copy
   -- as it is  more canonical (and as copying the initializer_list does
not force copy of the list items)
   -- current version anyway does not do what it is intended to
2020-12-01 09:34:53 +03:00
Anna Khakimova
56568dae31
Merge pull request #18674 from anna-khakimova:ak/backgroundSubtractor
GAPI: New BackgroundSubtractor stateful kernel

* New BackgroundSubtractorMOG2 kernel

* Add BS parameters
2020-11-30 18:09:42 +00:00
Orest Chura
986ad4ff06
Merge pull request #18857 from OrestChura:oc/kmeans
[G-API]: kmeans() Standard Kernel Implementation

* cv::gapi::kmeans kernel implementation
 - 4 overloads:
    - standard GMat - for any dimensionality
    - GMat without bestLabels initialization
    - GArray<Point2f> - for 2D
    - GArray<Point3f> - for 3D
 - Accuracy tests:
   - for every input - 2 tests
   1) without initializing. In this case, no comparison with cv::kmeans is done as kmeans uses random auto-initialization
   2) with initialization
   - in both cases, only 1 attempt is done as after first attempt kmeans initializes bestLabels randomly

* Addressing comments
 - bestLabels is returned to its original place among parameters
 - checkVector and isPointsVector functions are merged into one, shared between core.hpp & imgproc.hpp by placing it into gmat.hpp (and implementation - to gmat.cpp)
 - typos corrected

* addressing comments
 - unified names in tests
 - const added
 - typos

* Addressing comments
 - fixed the doc note
 - ddepth -> expectedDepth, `< 0 ` -> `== -1`

* Fix unsupported cases of input Mat
 - supported: multiple channels, reversed width
 - added test cases for those
 - added notes in docs
 - refactored checkVector to return dimentionality along with quantity

* Addressing comments
 - makes chackVector smaller and (maybe) clearer

* Addressing comments

* Addressing comments
 - cv::checkVector -> cv::gapi::detail

* Addressing comments
 - Changed checkVector: returns bool, quantity & dimensionality as references

* Addressing comments
 - Polishing checkVector
 - FIXME added

* Addressing discussion
 - checkVector: added overload, separate two different functionalities
 - depth assert - out of the function

* Addressing comments
 - quantity -> amount, dimensionality -> dim
 - Fix typos

* Addressing comments
 - fix docs
 - use 2 variable's definitions instead of one (for all non-trivial variables)
2020-11-30 13:18:43 +00:00
Anton Potapov
95ce8f45ea
Merge pull request #17851 from anton-potapov:sole_tbb_executor
* TBB executor for GAPI

 - the sole executor
 - unit tests for it
 - no usage in the GAPI at the momnet

* TBB executor for GAPI

 - introduced new overload of execute to explicitly accept tbb::arena
   argument
 - added more basic tests
 - moved arena creation code into tests
 -

* TBB executor for GAPI

 - fixed compie errors & warnings

* TBB executor for GAPI

 - split all-in-one execute() function into logicaly independant parts

* TBB executor for GAPI

 - used util::variant in in the tile_node

* TBB executor for GAPI

 - moved copy_through_move to separate header
 - rearranged details staff in proper namespaces
 - moved all implementation into detail namespace

* TBB executor for GAPI

 - fixed build error with TBB 4.4.
 - fixed build warnings

* TBB executor for GAPI

 - aligned strings width
 - fixed spaces in expressions
 - fixed english grammar
 - minor improvements

* TBB executor for GAPI

 - added more comments
 - minor improvements

* TBB executor for GAPI

 - changed ITT_ prefix for macroses to GAPI_ITT

* TBB executor for GAPI

 - no more "unused" warning for GAPI_DbgAssert
 - changed local assert macro to man onto GAPI_DbgAssert

* TBB executor for GAPI

 - file renamings
 - changed local assert macro to man onto GAPI_DbgAsse

* TBB executor for GAPI

 - test file renamed
 - add more comments

* TBB executor for GAPI

 - minor clenups and cosmetic changes

* TBB executor for GAPI

 - minor clenups and cosmetic changes

* TBB executor for GAPI

 - changed spaces and curly braces alignment

* TBB executor for GAPI

 - minor cleanups

* TBB executor for GAPI

 - minor cleanups
2020-11-30 13:15:13 +00:00
Anatoliy Talamanov
7521f207b1
Merge pull request #18762 from TolyaTalamanov:at/support-garray
[G-API] Wrap GArray

* Wrap GArray for output

* Collect in/out info in graph

* Add imgproc tests

* Add cv::Point2f

* Update test_gapi_imgproc.py

* Fix comments to review
2020-11-27 17:39:46 +00:00
Orest Chura
2c6a2f0381
Merge pull request #18790 from OrestChura:oc/fitLine
[G-API]: fitLine() Standard Kernel Implementation

* fitLine API (Mat, 32S, 32F) (2D, 3D)

* Complete fitLine kernel & accuracy tests
 - initialization for vectors of cv::Point and Mats via vectors added
 - comparison functions for Vec<T, n> added:
   - straight average difference comparison
   - comparison by equasion for 2d line
 - stream overload for cv::DistanceTypes added

* Fix precommit warnings

* Fix docs

* Address comments
Try to fix warning

* Disable warning in tests
2020-11-17 15:59:59 +00:00
Dmitry Matveev
b866d0dc38
Merge pull request #18793 from dmatveev:dm/in_graph_metadata
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
2020-11-17 14:04:19 +00:00
Alexander Alekhin
d0b6637c1d Merge pull request #18720 from rgarnov:rg/nd_rmat_view 2020-11-16 12:05:08 +00:00
Ruslan Garnov
724001aa0f Added multidimensional RMat::View steps 2020-11-12 13:15:02 +03:00
Alexander Alekhin
5564d73071 Merge pull request #18770 from mshabunin:fix-kw-1 2020-11-11 16:14:15 +00:00
Orest Chura
3fc1c73064
Merge pull request #18510 from OrestChura:oc/boundingRect
[G-API]: findContours() and boundingRect() Standard Kernels Implementation

* Add findContours() standard kernel
 - API and documentation provided:
   - as OpenCV provides two overloads whether to calculate hierarchy or not, but they differ by only the output in sight of G-API, two different G-API functions and kernels implemented
   - G-API Imgproc documentation divided into more parts according to imgproc module parts
   - some typos connected with division into parts corrected
 - `GArray<GArray<U>>` overload for `get_out` function provided to coonvert correctly into `vector<vector<U>>`
 - OCV backend supported
 - accuracy tests provided

* Add boundingRect() standard kernel
     - API and documentation provided:
       - GOpaque<Rect> used as an output
       - as OpenCV provides two possibilities whether to take a gray-scale image or a set of 2D points (`Point2i` or `Point2f` supported), three different overloads of a single G-API function and three kernels implemented
          - for a gray-scale image the overload via `GMat`
          - for a set of `Point2i` - the one via GArray<`Point2i`>
          - set of `Point2f` -> GArray<`Point2f`>
     - OCV backend supported
     - accuracy tests provided
       - comparison function for Rects provided
     - some typos in `gapi_tests_common` corrected

* Fix precommit windows warnings

* - Addressing comments:
   - split tests
 - Fix Windows warnings

* Static_cast for warnings

* - Remove randomness
 - Fix unnecessary precision losses

* - Forgot reference for RNG

* addressing comments

* equalizeHist -> no group

* `const` addedin new functions

* Address suggestions:
 - Hierarchical -> H
 - added cv::GMatDesc::isVectorPoins()
 - added support of giving a set of points to boundingRect()

* Addressing comments
 - IoU comparison function added for Rects
 - isPointsVector moved from a GMatDesc method to a separate function in imgproc.hpp
 - enums instead of int
 - typos corrected

* Addressing comments
 - findContours: Point offset -> GOpaque<Point>
 - removed "straight" comparison for Rects, IoU available only
 - changed vectors initialization -> fix Debug test run
 - Some typos

* added comment for later upgrades

* Fix not to corrupt docs by FIXME

* Addressing commens
 - overload without offset added (as a temporary workaround)
 - checkMetaForFindingContours -> validateFindingContoursMeta
 - added ostream overload for enums used in tests
2020-11-11 12:13:10 +00:00
Maksim Shabunin
1b0dca9c2c Fix issues found by static analysis 2020-11-11 13:59:01 +03:00
Orest Chura
5f1ca33c6f
Merge pull request #18652 from OrestChura:oc/morphologyEx
[G-API]: morphologyEx() Standard Kernel Implementation

* cv::gapi::morphologyEx() kernel
 - implemented (without separate 3x3 version)
 - tests added: check only different operations, not kernels/borders

* Address comments: add `const` where needed

* Replaced fundamental tyeps -> enums where needed
 - added operator<< overload for cv::MorphTypes for tests output
2020-11-10 18:57:52 +00:00
Dmitry Matveev
a110ede0a2
Merge pull request #18716 from dmatveev:dm/upstream_onnx
* G-API: Introduce ONNX backend for Inference

- Basic operations are implemented (Infer, -ROI, -List, -List2);
- Implemented automatic preprocessing for ONNX models;
- Test suite is extended with `OPENCV_GAPI_ONNX_MODEL_PATH` env for test data
  (test data is an ONNX Model Zoo repo snapshot);
- Fixed kernel lookup logic in core G-API:
  - Lookup NN kernels not in the default package, but in the associated
    backend's aux package. Now two NN backends can work in the same graph.
- Added Infer SSD demo and a combined ONNX/IE demo;

* G-API/ONNX: Fix some of CMake issues

Co-authored-by: Pashchenkov, Maxim <maxim.pashchenkov@intel.com>
2020-11-03 18:39:16 +00:00
Anatoliy Talamanov
2a3cdba724
Merge pull request #18701 from TolyaTalamanov:at/introduce-config-for-ie-params
Expand ie::Params to support config

* Add config to IE params

* Add test

* Remove comments from tests

* Rename to pluginConfig

* Add one more overloads for pluginConfig

* Add more tests
2020-11-03 17:47:05 +00:00
AsyaPronina
48ccbe39b4 Changed behaviour of cv::gapi::serialize, cv::gapi::deserialize for GCompileArgs
- cv::gapi::serialize bypasses compile arguments which have no S11N specialization with serialize/deserialize callbacks for underlying types
- cv::gapi::deserialize can accept arbitraty number of serialized compile args in a stream but will return only those which are requested by user via template parameter pack if they are presented in the stream. If some or all of them are not presented cv::gapi::deserialize will ignore and return only those which are presented
- cv::gapi::deserialize can accept only types which can be deserialized (have S11N<T> specialization with the user callbacks)
- Added cv::gapi::s11n::detail::has_S11N_spec<T> trait to separate compile arguments which have S11N<T> specialization with the user callbacks
2020-11-02 18:55:54 +03:00
Dmitry Matveev
ca8bb8d053 G-API: Introduce streaming::desync and infer(ROI)
- desync() is a new (and for now, the only one) intrinsic
  which splits the graph execution into asynchronous parts
  when running in Streaming mode;
- desync() makes no effect when compiling in Traditional mode;
- Added tests on desync() working in various scenarios;
- Extended GStreamingExecutor to support desync(); also extended
  GStreamingCompiled() with a new version of pull() returning a
  vector of optional values;
- Fixed various issues with storing the type information & proper
  construction callbacks for GArray<> and GOpaque;

- Introduced a new infer(Roi,GMat) overload with a sample;

- Introduced an internal API for Islands to control fusion
  procedure (to fuse or not to fuse);
- Introduced handleStopStream() callback for island executables;
- Added GCompileArgs to metadata of the graph (required for other
  features).
2020-10-29 20:19:15 +03:00
Anatoliy Talamanov
93c3775927
Merge pull request #18491 from TolyaTalamanov:at/wrap-inference
[G-API] Wrap cv::gapi::infer<Generic> into python

* Introduce generic infer

* Move Generic to infer.hpp

* Removew num_outs

* Fix windows warnings

* Fix comments to review

* Fix doxygen

* Add comment

* Fix comments to review

* Wrap inference to python

* Add default ctor to Params

* Add test

* Fix clang build

* Implement GInferInputs/GInferOutputs as Pimpl

* Add checkIEtarget to infer test

* Fix path

* Supress warning

* Use getAvailableDevices insted of checkIETarget

* Move PyParams to bindings_ie

* Add namespace

* Update CMakeLists.txt
2020-10-26 19:02:03 +00:00
Alexander Alekhin
bd40952097 Merge pull request #18622 from TolyaTalamanov:at/fix-namespace 2020-10-22 17:43:23 +00:00
Dmitry Matveev
95ff928228 G-API: Introduced a Text Detection sample
This sample models the Text Detection demo from OMZ:
https://github.com/openvinotoolkit/open_model_zoo/tree/2020.4/demos/text_detection_demo

Also: renamed cv::gapi::size() to cv::gapi::streaming::size()
2020-10-21 17:25:56 +03:00
Alexey Smirnov
2669d8ce73
Merge pull request #18584 from smirnov-alexey:as/rmat_s11n
[G-API]: Introduce RMat serialization API

* Introduce RMat serialization API

* Fix RunArgs deserialization

* Address review comments

* Export operators for GRunArg serialization

* Fix warning and add handling for RMat in bind()

* Update CMakeLists.txt

* G-API: RMat S11N -- probably fix the Windows warning
2020-10-20 20:58:54 +00:00
Anatoliy Talamanov
49d5960a32 Fix namespace for OCVCallHelper 2020-10-19 14:19:17 +03:00
Dmitry Budnikov
dcfa23d5d2 KW fixes 2020-10-19 13:46:23 +03:00
Anatoliy Talamanov
8bf451a3e0
Merge pull request #18542 from TolyaTalamanov:at/import-network
[G-API] Support ImportNetwork for cv::gapi::infer

* wip

* Refactoring

* Fix comments to review

* Fix warning

Co-authored-by: Ruslan Garnov <ruslan.garnov@intel.com>
2020-10-15 13:59:02 +00:00
Anatoliy Talamanov
0d3e05f9b3
Merge pull request #18493 from TolyaTalamanov:at/wrap-streaming
[G-API Wrap streaming

* Wrap streaming

* Fix build

* Add comments

* Remove comment

* Fix comments to review

* Add test for python pull overload
2020-10-14 22:21:09 +00:00
Alexander Alekhin
06a09d5991 Merge pull request #18583 from weltonrodrigo:remap_inter_doc_4 2020-10-14 18:06:59 +00:00
Anna Khakimova
4c048a487e
Merge pull request #18516 from anna-khakimova:ak/bgr2rgb
GAPI: Addition new Color conversion kernels to CPU backend.

* Add BGR2RGB kernel to CPU backend

* Add BGR2I420 and RGB2I420 kernels to CPU backend

* Add I4202BGR and I4202RGB kernels to CPU backend
2020-10-14 16:51:35 +00:00
Welton Rodrigo Torres Nascimento
09a62012b2 Doc update. INTER_LINEAR_EXACT unsupported in remap 2020-10-14 11:09:12 -03:00
Anatoliy Talamanov
76be3529f4
Merge pull request #18419 from TolyaTalamanov:at/generic-inference
[G-API] Introduce generic version for cv::gapi::infer

* Introduce generic infer

* Move Generic to infer.hpp

* Removew num_outs

* Fix windows warnings

* Fix comments to review

* Fix doxygen

* Add comment

* Fix comments to review

* standoalone ifdef in ginfer.cpp

* Fix test
2020-10-08 22:12:25 +00:00
Anastasiya(Asya) Pronina
af2f8c69f0
Merge pull request #18496 from AsyaPronina:comp_args_serialization
Serialization && deserialization for compile arguments

* Initial stub

* Add test on serialization of a custom type

* Namespaces rework

* Fix isSupported in test struct

* Fix clang lookup issue

* Initial implementation

* Drop the isSupported flag

* Initial implementation

* Removed internal header inclusion

* Switched to public API

* Implemented serialization

* Adding desirialize: WIP

* Fixed merge errors

* Implemented

* Final polishing

* Addressed review comments and added debug throw

* Added FluidROI test

* Polishing

* Polishing

* Polishing

* Polishing

* Polishing

* Updated CMakeLists.txt

* Fixed comments

* Addressed review comments

* Removed decay from deserialize_arg

* Addressed review comments

* Removed extra inclusion

* Fixed Win64 warning

* Update gcommon.hpp

* Update serialization.cpp

* Update gcommon.hpp

* gapi: drop GAPI_EXPORTS_W_SIMPLE from GCompileArg

Co-authored-by: Smirnov Alexey <alexey.smirnov@intel.com>
Co-authored-by: AsyaPronina <155jj@mail.ru>
2020-10-07 21:48:49 +00:00
Dmitry Matveev
050c960dfc G-API: Integrated cv::MediaFrame as I/O type + CPU backend 2020-10-05 20:21:15 +03:00
Ruslan Garnov
5224d016e9
Merge pull request #18339 from rgarnov:rg/rmat_integration
[GAPI] RMat integration into the framework

* RMat integration

* Added initialization of input mat in GArray initialization tests

* Fixed klocwork warnings in RMat tests, changed argument order in EXPECT_EQ
2020-10-04 18:57:41 +00:00
Alexey Smirnov
a3e7c2d8e3
Merge pull request #18452 from smirnov-alexey:as/export_serialization_api
[G-API] Export a part of serialization interface

* Initial stub

* Add test on serialization of a custom type

* Namespaces rework

* Fix isSupported in test struct

* Fix clang build and rework namespaces

* Remove redundant header
2020-10-01 18:11:23 +00:00
Orest Chura
40b8b58bc6
Merge pull request #18451 from OrestChura:oc/count_non_zero
[G-API]: countNonZero() Standard Kernel Implementation

* Add countNonZero() standard kernel
 - API and documentation provided
 - OCV backend supported
 - accuracy and performance tests provided
 - some refactoring of related documentation done

* Fix GOpaque functionality for OCL Backend
 - test for OCL Opaque usage providied

* countNonZero for GPU
 - OCL Backend implementation for countNonZero() added
 - tests provided

* Addressing comments
2020-09-30 16:07:35 +00:00
Dmitry Matveev
43d306fc2d
Merge pull request #18415 from dmatveev:dm/gframe_01_new_host_type
* G-API: Introduce cv::MediaFrame, a host type for cv::GFrame

* G-API: RMat -- address review comments
2020-09-29 19:19:54 +00:00
Anatoliy Talamanov
e998d89e88 Implement cv.gin and multiple output for python 2020-09-29 13:45:40 +03:00
Alexey Smirnov
8da1b9aafa
Merge pull request #18401 from smirnov-alexey:as/serialization_more_types
[G-API] Add support for more types serialization

* Support more types

* Add std::string support

* Fix GOpaque and gin interaction

* Fix tests on kind

* Make map serialization support templates and add tests on kind
2020-09-28 18:20:04 +00:00
Dmitry Matveev
e937d9b559
Merge pull request #18391 from dmatveev:dm/gframe_00_new_type
* G-API: Make GFrame a new (distinct) G-type, not an alias to GMat

- The underlying host type is still cv::Mat, a new cv::MediaFrame
  type is to be added as a separate PR

* Fix warnings and review comments

- Somewhow there was a switch() without a default: clause in Fluid
2020-09-23 18:25:14 +00:00
Alexey Smirnov
f6aa9ac304
Merge pull request #18292 from smirnov-alexey:as/osd_serialization
[G-API]: Support render primitives serialization

* Add GOpaque and GArray serialization support

* Address review comments

* Remove holds() method

* Add serialization mechanism for render primitives

* Fix standalone mode

* Fix wchar_t error on win64

* Fix assert on windows

* Address review comments

* Fix GArray and GOpaque reset() method to store proper kind

* Reset wchar before deserializing it

* Fix wchar_t cross-platform issue

* Address review comments

* Fix wchar_t serialization and tests

* Remove FText serialization
2020-09-21 19:08:58 +00:00
Alexander Alekhin
7163781639
Merge pull request #18343 from TolyaTalamanov:at/support-return-tuple
[G-API] Support std::tuple for return type
2020-09-18 16:38:37 +03:00
Maxim Pashchenkov
a63cee2139
Merge pull request #18287 from mpashchenkov:mp/ocv-gapi-blue-branch
[G-API]: Add four kernels to parse NN outputs & provide information in Streaming scenarios

* Kernels from GL "blue" branch, acc and perf tests

* Code cleanup

* Output fix

* Comment fix

* Added new file for parsers, stylistic corrections

* Added end line

* Namespace fix

* Code cleanup

* nnparsers.hpp moved to gapi/infer/, nnparsers -> parsers

* Removed cv:: from parsers.hpp
2020-09-18 13:31:16 +00:00
Maxim Pashchenkov
830d8d6b75
Merge pull request #18196 from mpashchenkov:mp/garray-initialization
[G-API]: Add GArray initialization support

* Added GArray initialization (CONST_VALUE, GScalar analog) and test for this

* Whitespaces

* And one more space

* Trailing whitespace

* Test name changed. Build with magic commands.

* GArray works with rvalue initialization

* Code cleanup

* Ternary operator in the initialization list.
2020-09-18 13:06:23 +00:00