Commit Graph
100 Commits
Author SHA1 Message Date
Mikhail Nosov a635150b9d [IE Common] Enable explicit TBlob declaration in all compilers (#11183)
* Enable explicit TBlob declaration in all compilers

This fixes problems when linking gcc compiled IE with clang compiled
applications.

Previous to this change, only clang compilers would consider TBlob<T>
templated types as declared externally. When *declared* explictly (with
the `extern template` syntax), the C++ spec says
that any inline methods of the templated class (such as TBlob<T>
constructors) should be ignored in favor of the externally instantiated
version of that templated type:

    "An explicit instantiation declaration (an extern template) skips
    implicit instantiation step: the code that would otherwise cause an
    implicit instantiation instead uses the explicit instantiation
    definition provided elsewhere (resulting in link errors if no such
    instantiation exists)."

However, when IE is compiled with gcc, it does not see the explicit
`extern template` declarations of TBlob<T> (due to the `#ifdef
__clang__` guards in `ie_blob.h`). As an end result, presumably due to
link-time-optimizations during IE library compilation(?), none of the
TBlob<T> implementations are actually included in the IE dynamic
libraries.

* Fix warnings for windows

* Fix typo
2022-03-30 18:56:49 +03:00
Mikhail Nosov 8bfde58fd9 [Core] Improve performance for 'ov::Model::add_output' (#11052)
* Improve performance for 'ov::Model::add_output'

On first call of `add_output(tensor_name)` all available tensor names are cached.
Next calls take nodes from cache which significantly reduces complexity.
Cache is invalidated if topological cache is not valid or cache points to incorrect output (no tensor name of this node anymore)

The same caching is done for 'add_output(op_name, output_index)'

Tests:
- Verifies that adding outputs to all nodes has linear complexity O(N), not O(N^2)
- Verifies cache invalidation scenarios

* Fix python tests

* Update topological cache after add_output(Output<Node>) by adding result to the end of cached ops

* Add 'm_shared_rt_info' to 'result node just for consistency (there is actually no scenario which may fail due to absence of this info for Result

* Added test cases to verify that names cache should be cleared on refresh of 'get_ordered_ops'
2022-03-25 12:17:41 +03:00
Mikhail Nosov 9d865a2133 [Model Caching] Enabling per-device cache dir (#10774)
* Initial commit

10 more caching tests

* Fix clang-format

* Added brief explanations to each test

* Fix review comments
2022-03-24 11:24:47 +03:00
Mikhail Nosov d84d00e2d6 Fix issue with output's friendly name after post-processing (#11095)
Scenario:
- Node "Split" with multiple outputs (e.g. 3). All outputs are connected to "Result"s
- Add post-processing step (e.g. convert element type, can be also implicit)

Issue: after post-processing, 3 new results will be created, each will have "Split" friendly name - inconsistency with IRv10 rules
Fix:
- For nodes with multiple outputs, add '.<idx>' suffix to new output's friendly name
- If no post-processing is applied, return immediately, keeping original results as is

Tests:
- Split with 3 outputs where 2 outputs have post-processing.
- Split with 3 outputs, post-processing doesn't create any nodes
2022-03-21 20:26:24 +03:00
Mikhail Nosov c4f5bce3b0 If CMAKE_BUILD_TYPE is not set - set it to 'Release' by default (#11026)
This behavior is already used by default because ONNX is enabled by default and thirdparty/onnx/onnx/CMakeLists.txt forcing CMAKE_BUILD_TYPE to Release if it is not set

It fixes the following issues:
- When ONNX frontend is disabled - source is built for Debug, which is very unexpected comparing to Release with ONNX frontend enabled
- When ONNX frontend is disabled, even libopenvino.so could not be built due to some generated makefiles issues

It is set to 'Release' (not to 'Debug') to comply with default behavior when ONNX is enabled (it is default option working for most users)
2022-03-18 06:59:36 +03:00
Mikhail Nosov 4b3dd808df [First Inference] Read time improvements via using 'mmap/munmap' (#10907)
* Performance improvement for constant creation

The issue is that 'are_all_data_elements_bitwise_identical()' is called every time in Constant constructor, and it potentially checks all buffer which is O(N) complexity.
While it is needed only if client uses 'get_all_data_elements_bitwise_identical'

Solution:
- Defer calculation until first call of 'get_all_data_elements_bitwise_identical'
- Store calculated value in mutable class member to reuse it on next calls of 'get_all_data_elements_bitwise_identical'

Test verifies both cases:
a) that constant creation with shared memory data (now O(1)) is significantly faster than creation+bitwiseCheck O(N)
b) Than once calculated, value is taken from cache, which is significantly faster than re-calculation

* fix clang-format

* Stash - Linux implementation

* Windows mmap implementation + unicode

* Clang for windows

* removed debug print

* Add handling of empty bin file

* fix windows includes

* Fix python test

* Unit tests
Fix for Constant with size > 4GB

* Fix review comments
2022-03-17 17:16:06 +03:00
Mikhail Nosov 857a1ad2af Caching snippets try/catch to make coverity happy (#11005) 2022-03-17 09:58:18 +00:00
Mikhail Nosov 7cea7dd4e6 Docs: model caching page update according to OpenVINO API 2.0 (#10981) 2022-03-16 12:22:33 +03:00
Mikhail Nosov 93722fe101 Docs. Fix link in layout overview (#10968) 2022-03-15 15:35:02 +00:00
Mikhail NosovandIlya Churaev ef5ad90dd7 [Read time improvement] Avoid calling of 'are_all_data_elements_bitwise_identical()' during Constant creation (#10858)
* Performance improvement for constant creation

The issue is that 'are_all_data_elements_bitwise_identical()' is called every time in Constant constructor, and it potentially checks all buffer which is O(N) complexity.
While it is needed only if client uses 'get_all_data_elements_bitwise_identical'

Solution:
- Defer calculation until first call of 'get_all_data_elements_bitwise_identical'
- Store calculated value in mutable class member to reuse it on next calls of 'get_all_data_elements_bitwise_identical'

Test verifies both cases:
a) that constant creation with shared memory data (now O(1)) is significantly faster than creation+bitwiseCheck O(N)
b) Than once calculated, value is taken from cache, which is significantly faster than re-calculation

* fix clang-format

Co-authored-by: Ilya Churaev <ilya.churaev@intel.com>
2022-03-15 10:03:47 +03:00
Mikhail NosovandIlya Churaev 72fe6082ea [Preprocess] InputTensorInfo::set_from implementation (#10839)
* InputTensorInfo::from implementation

If user's application already has `ov::runtime::Tensor` object created,
it will be possible to reuse basic characteristics for input (shape, precision) from tensor using InputTensorInfo::from method

* Rename 'from' to 'set_from' as  in Python 'from' keyword is used for import modules
Python bindings: from ov.Tensor and from numpy array

* Style fix (quotes)

* Apply suggestions from code review

Co-authored-by: Ilya Churaev <ilyachur@gmail.com>

* Fix code style

* Use set_from in hello_classification CPP sample

Co-authored-by: Ilya Churaev <ilyachur@gmail.com>
2022-03-14 18:02:51 +03:00
Mikhail NosovandIlya Lavrenov 96f954c704 [Preprocessing] Crop preprocessing support (#10805)
* Crop preprocessing support

Note: instead of 'ov::Coordinate' simple std::vector<int> is used because Coordinate don't support negative dimensions

Added unit tests, template reference tests, cpu and gpu tests

* Added python bindings
Fix review comments

* Fixed python code style

* Fix thresholds

* Fix python style

Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com>
2022-03-14 13:32:27 +03:00
Mikhail Nosov 43cb3920fb Docs: preprocessing use case with saving model to IR (#10698)
* Docs: added preprocessing use case with saving resulting model to IR

* Enable Model Caching to 'application code' section

* Fix review comments
2022-03-14 12:12:20 +03:00
Mikhail Nosov 86322c916b Fix loading time issues for POT models (with lots of results) (#10898)
* Fix loading time issues for POT models (with lots of results)

* Same for 'optimized_strided_slice'
2022-03-11 17:44:36 +03:00
Mikhail Nosov 5e023ebdd9 Fix issue with default arguments in preprocessing python bindings (#10702)
* Fix in Preprocessing python bindings - add correct default arguments for:
    - PreProcessSteps::convert_element_type
    - PostProcessSteps::convert_element_type
    - InputTensorInfo::set_color_format

Otherwise, python users must always specify optional params

E.g. instead of writing `tensor().set_color_format(ColorFormat.RGB)` python users will have to write `tensor().set_color_format(ColorFormat.RGB, [])`

* Corrected 'help' output

* Exposing 'openvino.runtime.Type.undefined' and use it in 'convert_element_type' documentation
2022-03-01 17:32:36 +03:00
Mikhail Nosov 173f328c53 Checking compatibility between 'pyopenvino' and 'libopenvino' (#10668)
* Checking compatibility between 'pyopenvino' and 'libopenvino' on 'import phase'

This fix is to prevent undefined behavior when user loads OpenVINO from python, but pyopenvino loads different version of 'libopenvino'
This may happen if user has several releases installed and played around PATH/PYTHONPATH environment variables.

In such case, user may have undefined behavior - application may crash in the middle of the usage or use incorrect release.

Fix checks build versions for pyopenvino and ov::get_openvino_version. If mismatch occurs, exception is thrown.

This logic is disabled if user has built OpenVINO locally, experienced developers probably know what they're doing, so if version has 'custom_'  prefix - this logic is disabled

* Removed custom logic for CI_BUILD_NUMBER, it is reused from already included version.cmake

* Use addVersionDefines macro
2022-02-28 17:04:59 +03:00
Mikhail Nosov f82533005b [OV2.0] Preprocessing documentation (#10451)
* [OV2.0] Preprocessing documentation - first draft

* Small update

* Added ov::Layout overview

* Fix code style

* Preprocessing details - ~50% done

* Corrected links

* Fixed comments, added more docs

* Minor updates

* Couple more links

* Fixed comments

* Remove 'future' link
2022-02-21 19:20:23 +03:00
Mikhail Nosov d5e8e0fb88 Fix coverity findings - add nullptr check before dereferencing (#10375)
Even though it is not possible to hit into this situation using existing plugins - there is theoretical possibility that some plugin may return 'nullptr' as it is allowed.
So this check shall remain in generic part which should not rely on plugin-specific behavior
2022-02-15 18:01:05 +03:00
Mikhail Nosov 2f876e3b5b Fix ONNX's PriorBoxClustered accuracy (#10091)
* Fix ONNX's PriorBoxClustered accuracy
If step_heights == 0 and step_heights == 0, but 'step' is 16, then we should treat this as both = 16

* Removed workaround for ONNX frontend
2022-02-14 20:55:41 +03:00
Mikhail Nosov d85715f991 Remove dynamism from API 1.0 (#10167)
* Refresh the PR

* Added check for dynamic inputs to LoadNetwork/QueryNetwork

* Fix review comment

* Added 'validation' callback to 'load network from file'

* Fix MockICore

* Added null-pointer check
2022-02-13 20:41:14 +03:00
Mikhail Nosov 5535fdefa9 Fix coverity scan issues (#10266)
* Fix coverity scan issues

For virtual 'noexcept' functions everything that can throw exception shall be handled inside function

* Remove 'noexcept'
2022-02-11 10:44:57 +03:00
Mikhail Nosov f56c640550 SmartReshape: support Param->Convert->Reshape->Proposal pattern (#10204)
Current SmartReshape finds matched to Param->Reshape->Proposal patterns

    For FP16 models, there is additional 'Convert' is inserted after 'Parameter'.

    It causes transformation is not applied and 'ov::set_batch' or CNNNetwork::set_batch will throw

    Proposal1Scales and Proposal4Scales transformations were updated to handle these conditions
2022-02-09 17:44:54 +03:00
Mikhail Nosov abda6eb4af Remove 'evaluate' from I420toRGB/BGR operations (#10128) 2022-02-07 13:05:51 +03:00
Mikhail NosovandIlya Lavrenov 9f9df184c4 Added compatibility check of layout with partial shape (#10144)
* Added compatibility check of layout with partial shape

E.g. layout "NC" in not compatible with PartialShape{1,3,224,224}

Check is added:
- For parameter set_layout
- For parameter set_partial_shape
- For result set_layout
- Checked also compatibility for all results after 'validate_and_infer_types'

* Fix incorrect tests

* Fix of more incorrect tests

* Removed couple of obsoleted error-handling tests - these are catched now on earlier stages

Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com>
2022-02-07 11:17:28 +03:00
Mikhail Nosov 4e4b04bbd3 LSTMSequence/GPUSequence - fix validate_and_infer_types (#9996)
* Fix LSTMSequence/GPUSequence validation behavior consistent with RNNSequence

Fixed issue with no exception if num_directions=2, but 'm_direction' is not set to BIDIRECTIONAL. Previously there was no error with this (and luckily it failed later in some CPU transformations during compile_network)

Corrected several tests which use copy-pasted num_directions=2 without m_direction set
Also for dynamic 'num_directions' - output shape still has 1 or 2 directions, because m_direction is known. Tests for GRU/LSTM are updated for this
Also several tests worked incorrectly for LSTMv0 - expectation was specific error to be thrown, but no expection was also allowed

* Fixed clang-format
2022-01-31 08:24:43 +03:00
Mikhail Nosov 2b87f000ed ROI tensor support for Template plugin (#9914)
* ROI tensor support for Template plugin + tests for Template and CPU plugins

GPU doesn'tsupport ROI tensors, so tests were not added for GPU

* Added asserts for unsupported mixed axis order (like 0,3,1,2), and unsupported types like int4/int2 for ROI tensors
2022-01-29 10:52:52 +03:00
Mikhail Nosov cf328d299f More fixes of plugins.xml generation (#9942)
* Further fixes of plugins.xml generation
1) Unregistration is done by name (e.g. CPU), not by file name (ov_cpu_plugin)
2) Unregistered line is searched by name="MULTI" instead of just 'MULTI' to not conflict with MULTI_WORK_MODE_AS_AUTO entry
3) Removed list of all possible plugins from ov_runtime as logic shall not rely on this (not possible to add 3rd party plugins)

* Revert ov_runtime - some CI jobs require plugins.xml even though plugins are not built

Registration - if some entry already exists in XML - don't copy it.
E.g.
- Registration of 'TEMPLATE' is performed
- Registration loops through existing plugins.xml
   - If name="TEMPLATE" is found - don't take it to newContent
   - If name like "myCustomPlugin" is found - take it
- As result - "myCustomPlugin" will exist after update, but old "TEMPLATE" will be removed

* Add missing change
2022-01-27 16:54:21 +03:00
Mikhail Nosov 6d40e5df96 'If' deserialization fixes (#9881) 2022-01-26 17:50:43 +03:00
Mikhail Nosov 8f94d6dd3f Fix unity build for 'inference_engine_s' target (#9899)
Without fix, build of 'cpuUnitTests' will fail as 'inference_engine_s' will contain:
IE_STATIC_DEPENDENT_FILES = file_utils.cpp
$<TARGET_OBJECTS:${TARGET_NAME}_obj> - containing 'unity_cxx' which includes 'file_utils.cpp'
This causes multiple definition error of all methods inside file_utils.cpp
2022-01-26 17:11:40 +03:00
Mikhail Nosov 2ea52bae6e Fixes of plugins.xml generation (#9922)
- Added registration (and unregistration) of ov_auto_batch_plugin. Otherwise 'BATCH' plugin will always produce new XML line without removing old one
- Added unregistration of legacy plugin names (<= 2021.4 release). Otherwise old lines like "libHeteroPlugin.so" will not be removed from plugins.xml file
2022-01-26 16:00:04 +03:00
Mikhail Nosov 1b3ca1b671 Fix klocwork warning (#9800)
Functionality is already covered by tests. In case of incorrect logic, like
`need_validate=need_validate || impl.build(...)` some test cases will fail
2022-01-24 13:59:30 +03:00
Mikhail Nosov d8e557b39c FrontEnds.cmake: FEM include headers as public (#9792)
ONNX/Paddle/TF frontends: added 'standalone_build' target to verify that frontends can be used standalone by applications
2022-01-21 13:43:07 +03:00
Mikhail Nosov 7f10473b96 Loop/If/TensorIterator - fix dynamic input cases (#9752)
* Loop/If/TensorIterator - fix dynamic input cases
Reference evaluate for body uses Model::evaluate instead of custom evaluation
Loop/TensorIterator additional fix - set result shape according to body execution result

Only op_eval test verifies issues, template tests were added just in case (these passed even without fix)

* Fix clang-format

* rename ti.cpp
2022-01-21 13:27:20 +03:00
Mikhail Nosov 7126bef2be [Python Bindings] Frontend test for telemetry extension (#9768)
* Python bindings - test for telemetry extension

This also ensures that actual 'Telemetry' object containing callbacks is still alive even there is no explicit Python objects holding it

* Fix pylint

* fix clang-format
2022-01-20 16:44:54 +03:00
Mikhail Nosov 9f2cb8e102 [PyBind] Fix crash on destroying dtype_to_ov_type static map (#9772)
* Use std::string for static map instead of py::str

Probable reason is that this static map is destroyed after 'pybind' module is destoryed itself, thus py::str can't be cleaned up properly

* Added test via 'subprocess' execution of separate file
2022-01-19 21:01:18 +03:00
Mikhail Nosov 690e7a5958 Local build seems good today (#9402) 2022-01-19 11:15:40 +03:00
Mikhail Nosov 26f222dea5 [Tests] Graph comparator - take sinks into accounts (#9695)
* Graph comparator - take sinks into accounts

Previously graph has been traversed only from Results, so any differences in 'Sinks' were not detected

* Fix functional tests

* Update after internal discussion

* Fix low_latency_test (addition to low_latency_v2_test)

* Fix typo
2022-01-18 09:01:05 +03:00
Mikhail Nosov fc6eff048f Python bindings: expose InputTensorInfo::set_memory_type (#9608)
* Exposing set_memory_type method

* Update quotes
2022-01-13 12:48:26 +03:00
Mikhail Nosov 896532ace2 [OV2.0] PrePostProcessor dump to output stream for debugging purposes (#9580)
* Calculate model layout based on 'tensor' layout and convert steps

Previously, 'model layout' is set to '...' by default,
thus no shape conversion happened when tensor layout is set to 'NHWC', then there was explicit convert_layout "NCHW"

Now "model layout" is calculated based on tensor layout and conversion steps:
Examples:
 1) Tensor: NHWC, Convert: NCHW. Result: NCHW
 2) Tensor: NHWC, Convert: 0312. Result: NCHW

* Initial move of tensor data calculation

* Moved 'impls' to new file

* Postprocessing + unit tests

* clang-format fix

* Added more details to preprocessing nodes
- Mean/Scale - will print mean/scale values
- Convert type - will print type
- Convert layout - will print destination layout
- Convert color - will print destination color

It is needed to troubleshoot the problems. If error occurs, message will not display last op's target shape/layout/type

* Add python bindings

* update tests

* Added memory type to dump if set

* Code style fix

* unity build fix

* Dump tensor if only memory type is set

* Added debug print

* Fix Param->Result case

Previously, layout was set by preprocessing set to old parameter as well
This is incorrect because in case of exception layout info will not be reverted

In this case old Result pointed to old Parameter and was able to preserve runtime info

After fixing of this, case Param->Result was broken if revalidation is not triggerred

Fix is to detect 'Result' as a consumer of some parameter and force revalidation in this case

* Revert occasionally committed line

* And one more line
2022-01-12 22:00:32 +03:00
Mikhail Nosov a6c9f9aeab Move 'NV12toRGB/BGR' reference evaluates to template plugin (#9548)
* Move 'NV12toRGB/BGR' reference evaluates to template plugin

CPU doesn't need this fallback, so implementation can be moved to reduce core binary size

* Moved evaluate_nv12 to 'runtime::reference'

* Fix arm build
2022-01-12 14:29:03 +03:00
Mikhail Nosov 26a78fcb5d [OV2.0] Calculate model layout based on 'tensor' layout and convert steps (#9550)
* Calculate model layout based on 'tensor' layout and convert steps

Previously, 'model layout' is set to '...' by default,
thus no shape conversion happened when tensor layout is set to 'NHWC', then there was explicit convert_layout "NCHW"

Now "model layout" is calculated based on tensor layout and conversion steps:
Examples:
 1) Tensor: NHWC, Convert: NCHW. Result: NCHW
 2) Tensor: NHWC, Convert: 0312. Result: NCHW

* Fix for set_shape + resize case
2022-01-12 10:52:02 +03:00
Mikhail Nosov bd3a996239 [OV2.0] Preprocessing: support convert HWC->NCHW layout (#9540)
* Initial implementation

* Template reference tests

* cpu & gpu tests for HWC -> NCHW conversion
2022-01-11 13:13:37 +03:00
Mikhail Nosov 9cc4504b78 Removed OV_FRONTEND_PATH from 'setupvars' scripts (#9396)
* Removed OV_FRONTEND_PATH from 'setupvars' scripts

* Update linux.yml

* Change mock frontend's install dir for static builds

* revert linux.yml
2021-12-24 13:01:51 +03:00
Mikhail Nosov 7bfbb46d73 [FE API]: Shared object (SO) holder to frontend's library for FrontEnd/InputModel/ov::Model (#9308)
* Squashed commit of previous work

* Fix mock tests

* clang

* Fix rebase errors

* remove unnecessary changes

* One more finding

* Copy ov::Model runtime info as well

* Fix review comments

* Commit missing file

* Copy m_shared_object when cloning model

* removed copy_shared_objects and use clone_model(model, NodeMap) as a friend for ov::Model

* Added OPENVINO_API to forward declaration

* add OPENVINO_API to friend function declaration
2021-12-24 02:56:45 +03:00
Mikhail Nosov 8f908db61e [OV20] Set tensors infer req (#9158)
* Fix incomprehensible error message during layout conversion when layout rank doesn't match with shape rank

* Stash

* stash

* Memcpy implementation
Added tests

* Revert "Fix incomprehensible error message during layout conversion when layout rank doesn't match with shape rank"

This reverts commit 37064741b2.

* Fix clang-format and remove redundant headers

* Covered "cached" case (+ tested on Myriad)

* Apply review comments
Introduced 'applyBatchedBlob' function which allows override 'memcpy' on inferefnce time

* clang-format fix

* Added dynamic shape case

* - Review comments
- Deep copy of parameters/results for caching from cnnNetwork. Deep copy logic is moved to Utils
- Caching Tests: return correct inputs/outputs map after ImportNetwork mock call

* Reworked according to discussion

Also introduced 'SetBlobsImpl' which throws 'Not implemented' exception by default.
Template plugin updates internal '_batched_inputs' map

* Updated according to moved tests

* don't support 'memcpy' for ROI tensors

* Fix caching tests

* Just to retrigger CI

* Correct offset padding (however there is no test update as current implementation will not hit here due to other checks)

* Fix clang-format

* Applied review comments

* Added check that 'get_tensor' throws if set_tensors/set_input_tensors is used

* Fix review comments - part 1

* Fix caching tests - mock implementation becomes more complicated
Cached mock model shall identify its inputs/outputs, otherwise core will assert on SetExeNetworkInfo stage

* More comments fix

* More comments fixes

* More cleanup

* And more style comment

* typo fix

* Try fix caching windows tests

* Blind attempt to fix Ubuntu20 CI
2021-12-23 01:19:28 +03:00
Mikhail Nosov b7ffbe5459 Leftover: Added tests for fix for PR #8546 (#9313)
Added more preprocessing unit tests for fix of PR #8546
Testing: revert changes for the fix. Verify that new tests are failed
2021-12-20 23:32:14 +03:00
Mikhail Nosov c7a3c93d3f FrontEnd API - change 'shared_ptr' to 'const shared_ptr&' (#9287)
* FrontEnd API - change 'shared_ptr' to 'const shared_ptr&' in public arguments

* Fix clang-format
2021-12-17 22:39:13 +03:00
Mikhail Nosov 4fea4024b4 Overwrite 'model' layout with preprocessing when layout is already set (#9258) 2021-12-17 00:55:47 +03:00
Mikhail Nosov 135849cf6c [OV20] Preprocessing - back propagation of 'tensor layout' when convert-by-dims is used (#9129)
* Fix back propagation of layout when 'convert with dims' is specified

* Remove original 'reuse param's layout', as it is covered by back-propagation logic

* Remove debug test output
2021-12-12 01:01:35 +03:00
Mikhail Nosov 45bdf627cb [OV20] Preprocessing: User friendly error message for convert_layout (#9077)
* Fix incomprehensible error message during layout conversion when layout rank doesn't match with shape rank

* clang-format fix, Removed debug print

* Updated unit test according to review comments

* Moved apply_permutation and find_permutation to src/layout_utils.hpp
2021-12-11 03:42:46 +03:00
Mikhail Nosov c45a8f1e18 Fix conflict with PR 9054 (#9074) 2021-12-08 09:40:52 +03:00
Mikhail Nosov 757b757a20 Preprocessing - added test for dynamic spatial shapes (resize) (#8980)
* Preprocessing - added test for dynamic spatial shapes (resize)

* Applied review comments

* Remove unnecessary change

* Revert signature to keep compatibility with kmb plugin

* Try fix centos
2021-12-08 09:21:07 +03:00
Mikhail Nosov 20bf5fcc4a Rename "network" to "model" in preprocessing API (#9054) 2021-12-07 19:26:27 +03:00
Mikhail Nosov 70b5e28979 [OV20] InputTensorInfo::set_shape (#9059)
* InputTensorInfo::set_shape

* Fix clang-format
2021-12-07 19:13:38 +03:00
Mikhail Nosov 4abaef6702 [OV20] ov::Function - get/set batch size (#8955)
* Initial version (no tests)

* Added tests

* Fix centos

* Applied review comments

* Renamed 'ov::util::get_batch_size' to 'ov::pass::get_batch'. For set_batch_size update is the same

* Changed to ov::get_batch and ov::set_batch
2021-12-07 16:40:48 +03:00
Mikhail Nosov 92bdddbfc9 Fix for reverse-input-channels - semi-dynamic case (#8936)
In case of partially-dynamic shape, e.g. {?,3,?,?} shape inference
for gathering channels and reverse operations can't infer final shape to {?,3,?,?} and it becomes {?,?,?,?}

Added 'static' version of reverse-channels to preserve output shape for such cases
It can be changed in future if operations will be able to calculate shape on 'validate' phase
2021-12-07 16:39:24 +03:00
Mikhail Nosov b30adc7abd Fix build for conflicting PRs (8520 vs 9038) (#9061) 2021-12-07 14:50:56 +03:00
6ef59ce3e4 [OV2.0] Model Optimizer: mean/scale/reverse_input_channels/layout for new frontends (#8751)
* Preprocessing API - base classes

Includes API definition for trivial mean/scale operations (which don't require layout)

Mean/scale with 'layout' support will be done under separate task together
 with Layout

Current test code coverage: 100%

* Python bindings for base preprocessing API

* remove pre_post_process directory from ngraph/core

* remove files from ngraph/python dir

* move pyngraph pre_post_process files from ngraph/python to runtime

* remove pre_post_process test from CMakeList

* move include to the header

* update include path for pre_post_process

* style fix

* bind InputTensorInfo::set_layout

* cleaned test_preprocess

* fix test expected output

* remove duplicate test

* update description of set_element_type

* fix style

* move preprocess from pyngraph to pyopenvino/graph

* update test_preprocess imports and remove unnecessary test

* remove duplicate import

* update custom method

* update test

* update test

* create decorator that changes Node into Output<Node>

* create function that cast Node to Output<Node>

* update test_preprocess to use decorator for custom function

* change _cast_to_output -> _from_node

* move frontend folder to pyopenvino

* rename includes and add compile options

* include frontend to pyopenvino

* move __init__.py

* move tests

* remove mock from tests_compatibility

* rename import module

* Fix code style cpp

* refactor a few lines

* style fix

* update few lines in mo

* add tests fro scale and mean with vector input

* style fix

* add docstring for custom_preprocess_function

* bind InputInfo network method

* style fix

* Add pyopenvino to dependencies

* bind OutputInfo

* fix description of preprocess submodule

* fix style

* update copyright year

* Fix mock

* update docstring

* bind OutputTensorInfo

* bind OutputNetworkInfo and InputNetworkInfo

* bind ColorFormat and ResizeAlgorithm

* clean imports

* fix typo

* add PostProcessSteps to init

* bind PreProcessSteps

* create additional tests

* Fix mo test

* remove module local

* fix code style

* update comment

* fix return type

* update docs

* fix code style

* change ngraph.Type to ov.Type

* fix typo

* move _from_node to node_output.hpp

* add read_model from buffer

* update imports

* add new line

* remove bad quotes

* update imports

* style fix

* add new line

* rename functin args

* remove Type import

* update tests

* style fix

* test clean

* remove blank line

* update PrePostProcessor init and build methods

* create test with model update tests with new PrePostProcessor init and build

* # Conflicts:
#	inference-engine/ie_bridges/python/src/openvino/offline_transformations/offline_transformations_api.pyx
#	inference-engine/ie_bridges/python/src/openvino/offline_transformations/offline_transformations_api_impl.cpp
#	inference-engine/ie_bridges/python/src/openvino/offline_transformations/offline_transformations_api_impl.hpp
#	inference-engine/ie_bridges/python/src/openvino/offline_transformations/offline_transformations_api_impl_defs.pxd
#	inference-engine/tests/ie_test_utils/common_test_utils/ngraph_test_utils.cpp
#	inference-engine/tests/ie_test_utils/common_test_utils/ngraph_test_utils.hpp
#	model-optimizer/mo/moc_frontend/serialize.py
#	thirdparty/gflags/gflags
#	thirdparty/gtest/gtest

* Stash

* move preprocess module from openvino.impl to openvino

* fix building

* fix code style

* try to move MO to use new api

* Intermediate commit

* try to move MO to use new api

* Test pybind11 custom holder for Preprocessing types (InputInfo and PreProcessingSteps)

* Initial code for source_target layout handling for preprocessing
Initial implementation of reverse input channels

* Use input's tensor names instead of friendly names

* Skeleton for guessing layouts and clearing it after preprocessing

* updated package_BOM.txt

* Use reference_wrapper for preprocess bindings

* Update tests

* Layout::find_permutation - support of dynamic layouts
Covered case for 'trivial convert' where no permutation is needed
It is needed for Model Optimizer for logic which will guess model's layout, like "?c??"

* Stash

* add bindings to I420_SINGLE_PLANE and I420_THREE_PLANES

* remove init from all classes except PrePostProcessor and add RGBX and BGRX to ColorFormat enum

* Guess layout so that existing mean/scale tests passed

* update test name

* Draft to guess layout for 'reverse_input_channels'

* More unit tests (error cases)

* pylint & flake8

* pylint - ignore import error

* Stash

* Moved preprocessing to 'back' folder

* More tests

* Update package_BOM

* Support layout_values with no names
Support layout set for 'outputs'
Tests

* Export more enum names from nrgaph

* Basic --layout parsing

* removed debug prints

* Further updates after rebase

* Update imports

* Removed part from 8829

* Fix imports in test code

* Minor cosmetics

* Don't guess 'C' if layout is already set by model
Expose 'Layout::empty' method

* Style fix

* Apply review comments
Restricted 'heuristics'

C++: Added 'fp16', 'fp64' support to mean/scale

* Applied review comments

* Added some dynamic test cases

* Move call of 'apply_preprocessing' to 'serialize.py'

* Unnecessary change

* Added more comments to code

Co-authored-by: pszmel <piotr.szmelczynski@intel.com>
Co-authored-by: Alexey Lebedev <alexey.lebedev@intel.com>
Co-authored-by: bszmelcz <bartosz.szmelczynski@intel.com>
Co-authored-by: Anastasia Kuporosova <anastasia.kuporosova@intel.com>
Co-authored-by: y <ilya.lavrenov@intel.com>
Co-authored-by: Vafin, Maxim <maxim.vafin@intel.com>
2021-12-07 14:31:55 +03:00
Mikhail Nosov 8faa08da12 Fix preserving runtime info for result after post-processing (#9038) 2021-12-07 00:37:13 +03:00
Mikhail Nosov 3ab533a89c Fix array out-of-bounds error (#8966) 2021-12-02 00:07:37 +03:00
Mikhail Nosov caf1f22f63 Update according to new file structure (#8235)
Reworked according to comments

Tested manually only, as there is no way to change priority frontends list on test time
2021-12-01 16:53:20 +03:00
Mikhail Nosov 84a16513df Layout::find_permutation - support of dynamic layouts (#8766)
Covered case for 'trivial convert' where no permutation is needed
It is needed for Model Optimizer for logic which will guess model's layout, like "?c??"
2021-11-30 12:40:38 +03:00
Mikhail Nosov e2172cd38a [OV2.0] Preprocessing api cleanup (#8898)
* Removed 'inline' Preprocessing API

Even though this API provided a way to specify all pre/post-processing in one line - it was considered inconvinient
With 'getters' API preprocessing code looks more clear for user, so old' inline' API is removed

* Fix pyopenvino build issues

* Update after merged PR#8717
2021-11-30 12:30:13 +03:00
Mikhail Nosov c29569ecbd [TemplateFuncTests] RGBX->RGB: Increase image size to avoid test failures on some platforms (#8762)
* Increase image size to avoid test failures on some platforms

There is an assert 'length >= nlanes' and 'nlanes' value depends on machine architecture
Set 320x320 test image to guarantee that image size >= nlanes

Also increased image size for 'plugin shared tests' to ensure the same (even though tests do not work with legacy preprocessing)

* Descreased to 160x160
2021-11-23 15:26:22 +03:00
Mikhail Nosov 7545af07d0 Preprocessing: convert color RGBX/BGRX -> RGB/BGR implementation (#8755) 2021-11-23 10:29:00 +03:00
Mikhail Nosov d15dcd6833 Support 'set_memory_type(string)' for preprocessing info tensor info (#8721)
Testing: unit tests + serialization/deserialization tests
2021-11-22 19:42:23 +03:00
Mikhail Nosov e34a66d828 Typo fix in I420toRGB specification example (#8705) 2021-11-19 10:47:19 +00:00
Mikhail Nosov aaac5de2fa [OV2.0] I420 preprocessing color format support (#8680)
* Add I420 preprocessing

Tests:
- Template reference
- OpenCV
- Legacy Preprocessing tests
- Functional shared tests for plugins (CPU)
- Disable i420 preprocessing tests on GPU

* clang-format fix
2021-11-18 23:30:44 +03:00
Mikhail Nosov 03c8542357 [I420 color conversion] I420toRGB/I420toBGR reference implementation (#8605)
* ngraph part

* Template reference tests
Common plugin tests
CPU compliance tests
Serialization tests

* Clang format fixes

* Remove reference implementation for f16, bf16, f64 types

* Fix ninja build

* Fix opset8_dump test

* Fix opset8_dump test

* Fix CentOS build

* Removed Myriad preprocessing tests (to be added by separate PR)
2021-11-18 09:48:18 +03:00
Mikhail Nosov 2245ea8be2 [FrontEnd] Rename all frontends from "*_ngraph_frontend*" to "_ov_frontend*" (#8645)
* Renaming all frontends from "*_ngraph_frontend*" to "_ov_frontend*"

Also Debug builds on Windows release frontends without "d" suffix will not be loaded

* Fix review comments and add wheels test debug prints

* More debug prints

* Load by absolute path and remove debug prints
2021-11-18 09:26:13 +03:00
Mikhail Nosov c81e1aef05 [OV20] I420toRGB and I420toBGR operations specification (#8292) 2021-11-17 16:06:27 +03:00
Mikhail Nosov c2d09afab9 PreProcess API change: (#8629)
- PrePostProcessor takes 'function' argument in constructor
- PrePostProcessor::build() doesn't take any function anymore
- PrePostProcessor::input() method to get reference to input
- PrePostProcessor::output() method to get reference to output
- InputInfo - add getters of tensor, preprocess, network
- OutputInfo - add getters of tensor, preprocess, network

Samples:
ClassificationSampleAsync - use new getters

Inference engine:
- Use new getters in ie_network_reader.cpp

TODO: Consider removal of builder-like API in PrePostProcessor, InputInfo, OutputInfo
2021-11-17 00:51:19 +03:00
Mikhail Nosov a62897dc93 Fix disabled caching functional tests: (#8271)
- Create new objects of 'mock' executabl networks on each 'LoadNetwork'
- This allows creation of moc nets with different Input/Output Info
- Lock mutex during creation of mock objects in different threads. This is due to gmock stores 'mock' objects in non-thread-safe way
- Added comments of how to reproduce sporadic problems on disabled tests
- Enabled all disabled tests as problems are not observed anymore
2021-10-28 16:03:30 +03:00
Mikhail Nosov 5cb2174721 Layout: add _idx suffix for helper getters (#8196)
'layout::width' -> 'layout::width_idx', etc
2021-10-28 11:26:55 +03:00
Mikhail Nosov 846d1e0467 [OV2.0+Bugfix] Layout serialization + Fix caching issues with auto-generated friendly names (#8153)
* Fix caching issues with auto-generated friendly names

Introduce "HashPass" to calculate hash like a serialize but without auto-generated friendly names
IE Compilation context: use HashPass to calculate hash of ov::Function
IE Compilation context tests: removed "friendly names" from tests
Layout: serialization support + tests
Parameter/Result: update set/get_layout according to layout changes

* Fix clang

* Tiny correction of CmakeLists

* Renamed VariantWrapper<Layout> to LayoutAttribute
Removed test for conversion from/to fully dynamic layout (allowed now and does nothing)
'set_layout' - remove layout runtime info if empty layout is passed. This allows hashes to be the same if set_layout(param->get_layout()) is called

* Fix build

* change size_t to uint64_t for hash value
Using size_t leads to high probability of conflict for 32-bit platforms

* Removed debug print

* Fix hash calculation for 32-bit platforms

* Fix review comment
2021-10-27 21:05:06 +03:00
Mikhail Nosov a2a8969201 [OV20] Enable OpenCV tests and support 'u8' type for Interpolate op (#8182)
* Interpolate reference implementation:
- Support u8 and other numeric types
- For integral types - round result to nearest integer (don't cast)
Preprocessing: enable OpenCV tests and add resize conformance tests with OpenCV

* Revert changes in interpolate.cpp, making them minimal needed (added u8 resize)
2021-10-27 20:56:43 +03:00
Mikhail NosovandAlexander Zhogov 0880a7d4af PDPD: Revert 'Four Jobs' pool usage (#7912)
* Put JOB_POOL after comments

* Revert "Put JOB_POOL after comments"

This reverts commit a8fc4c64e5.

* Revert "Use jobs pool for PDPD model conversion as well (#7602)"

This reverts commit 1390440256.

Co-authored-by: Alexander Zhogov <alexander.zhogov@intel.com>
2021-10-27 16:06:04 +03:00
Mikhail Nosov 7ef4ff6385 Update only Reference implementation and tests (#8126)
There were discovered a lot of issues in 'CompareWithRefs' tests when generated float inputs are not rounded to 'int'
2021-10-27 12:29:37 +03:00
Mikhail Nosov 789c2377ca Fix potential data race and freeze for classification sample (#8201) 2021-10-27 12:29:21 +03:00
Mikhail Nosov d65e7d4d4f [OV20] Preprocessing: convert_layout<std::vector<uint64_t>> implementation (#8213)
* Preprocessing: convert_layout<std::vector<uint64_t>> implementation

User is able to use this version without specifying layout explicitly

Same version of convert_layout is added for post-processing

Added usage of new convert_layout to ie_network_reader

* Fix review comment
2021-10-27 11:32:44 +03:00
Mikhail Nosov 00866d90df [Caching] Disabled sporadically failed tests (#8238)
* Disabled sporadically failed tests

* Disabled one more test
2021-10-27 10:59:24 +03:00
Mikhail Nosov d39fe50470 [OV20] Preprocessing: reverse_channels and RGB<->BGR conversion (#8098)
* Initial draft

* Support of dynamic shapes
2021-10-21 11:22:43 +03:00
Mikhail Nosov e976a221f5 [OV2.0 Preprocessing] NV12 ref implementation fixes + tests with legacy CNNNetwork (#7985)
* NV12 Ref impl: Align with Legacy NV12 conversion
Little-endian tricks are completely not needed finally

Basic tests of OV20 preprocessing vs Legacy preprocessing:
- Mean/Scale
- Resize (Linear vs Bilinear)
- NV12 color conversion

* Register Template plugin in legacy core before CNNNetwork compliance test
NV12: round to nearest integer for 'u8' mode
Fix preprocess-reference NV12 tests (swap U & V)

* Decreased default threshold and use random distribution for inputs generation

* Added tests RefImpl vs OpenCV - NV12 color conversion
Added CPU accuracy tests + nightly (including all RGB color combinations)

* Fix build issue after rebase

* Remove test code

* Fix comments
Disable OpenCV tests on CI (some machines can't load opencv_imgproc during test)
2021-10-20 13:39:46 +03:00
Mikhail Nosov d21572d7cb Squashed commit of the following: (#7930)
commit e692037384525e24f4f88d2b10fd5f5c09881d8a
Merge: a0ad24b16 82f8f19d1
Author: Michael Nosov <mikhail.nosov@intel.com>
Date:   Wed Oct 13 15:06:20 2021 +0300

    Merge remote-tracking branch 'upstream/master' into ov20/remove_tensor_names

    # Conflicts:
    #	inference-engine/tests/functional/inference_engine/ir_serialization/rt_info_deserialization.cpp

commit a0ad24b16ab6ef7cf37dedb04084813178f0d627
Merge: 3c1f7067f db527fff4
Author: Michael Nosov <mikhail.nosov@intel.com>
Date:   Wed Oct 13 13:45:39 2021 +0300

    Merge remote-tracking branch 'upstream/master' into ov20/remove_tensor_names

commit 3c1f7067f01634378cf66eee996d8793b635a6f2
Author: Michael Nosov <mikhail.nosov@intel.com>
Date:   Wed Oct 13 13:45:13 2021 +0300

    Remove ignoring friendly names while comparing functions

commit f31e018d9a4694e83a3f12e685d8e90a9aca9045
Author: Michael Nosov <mikhail.nosov@intel.com>
Date:   Tue Oct 12 23:50:20 2021 +0300

    Fix macos test

commit 2e3d0ceced3bde893e1e8237f7769c94bd193531
Author: Michael Nosov <mikhail.nosov@intel.com>
Date:   Tue Oct 12 20:06:06 2021 +0300

    Fixes after merge

commit 5f047070af7c71a75f5ec019a146e17b3f95c062
Merge: 1568c9723 c323775f2
Author: Michael Nosov <mikhail.nosov@intel.com>
Date:   Tue Oct 12 18:59:21 2021 +0300

    Merge remote-tracking branch 'upstream/master' into ov20/remove_tensor_names

    # Conflicts:
    #	inference-engine/tests/functional/inference_engine/ir_serialization/rt_info_deserialization.cpp
    #	inference-engine/tests/functional/plugin/cpu/shared_tests_instances/skip_tests_config.cpp
    #	ngraph/core/src/preprocess/pre_post_process.cpp
    #	ngraph/core/src/preprocess/preprocess_steps_impl.cpp
    #	ngraph/core/src/preprocess/preprocess_steps_impl.hpp
    #	ngraph/test/util/graph_comparator.cpp

commit 1568c97238c206a43cd8b14b6aba49fcee828386
Author: Michael Nosov <mikhail.nosov@intel.com>
Date:   Tue Oct 12 13:56:48 2021 +0300

    Throw an error if 'InputInfo' is specified for same parameter twice.

commit d1830ba61b750b12484322c97261c7062551f798
Merge: 4f01b396b d79020457
Author: Michael Nosov <mikhail.nosov@intel.com>
Date:   Tue Oct 12 13:34:32 2021 +0300

    Merge remote-tracking branch 'upstream/master' into ov20/remove_tensor_names

commit 4f01b396ba4b68d88d583092a38836754e78531c
Author: Michael Nosov <mikhail.nosov@intel.com>
Date:   Tue Oct 12 13:34:19 2021 +0300

    Insert multi-plane parameters into new parameters vector (don't append them)

commit 70f85e5f351a37f2b79cff118399778c55136845
Author: Michael Nosov <mikhail.nosov@intel.com>
Date:   Tue Oct 12 00:26:43 2021 +0300

    Fixed failed CPU/GPU test, created skipped test to clearly reproduce the problem
    Don't generate friendly and tensor names for sub-planes. Test is updated
    Keep the order of created parameters and results after pre and post processing
    Added tests for params/results order

commit 8b2cbf6db6646f6b2a01fc9e75726b682aa87fc2
Merge: 6050afbce 6d322722c
Author: Michael Nosov <mikhail.nosov@intel.com>
Date:   Mon Oct 11 17:55:25 2021 +0300

    Merge remote-tracking branch 'upstream/master' into ov20/remove_tensor_names

commit 6050afbce256f21430322ec7b0a38105e3f06066
Author: Michael Nosov <mikhail.nosov@intel.com>
Date:   Sun Oct 10 23:54:40 2021 +0300

    IE reader: remove unnecessary convert_layout()

commit 0f43133f6dfddf41233835678872c9a80b631565
Author: Michael Nosov <mikhail.nosov@intel.com>
Date:   Sun Oct 10 23:33:29 2021 +0300

    Update IE tests

commit 75afe69ccf36b9764dc9285d77fe1a65ae4146b4
Merge: c86366577 67cfc9beb
Author: Michael Nosov <mikhail.nosov@intel.com>
Date:   Fri Oct 8 22:52:17 2021 +0300

    Merge commit '67cfc9beb5bb0c66916c91ab5820dc25ad164a70' of https://github.com/openvinotoolkit/openvino into ov20/remove_tensor_names

commit c86366577ede8491ed722f9d048b7556d3266c68
Author: Michael Nosov <mikhail.nosov@intel.com>
Date:   Fri Oct 8 22:26:17 2021 +0300

    First commit (IE func tests are failed)

commit 67cfc9beb5bb0c66916c91ab5820dc25ad164a70
Author: y <ilya.lavrenov@intel.com>
Date:   Fri Oct 8 16:09:11 2021 +0300

    Removed explicit preprocessing steps
2021-10-14 17:54:41 +03:00
Mikhail Nosov aa6d1f873b Fix issue with onnx model generation (#8011) 2021-10-14 17:49:05 +03:00
Mikhail Nosov 2592856200 [OV2.0] Leftovers for Preprocessing/input/output (#7893)
* Pre-process:
- Implicit conversions for element type and layout
- 'convert_element_type' with default argument to network
- Convert_element_type - don't add ops if dst and src types are same
- Convert_layout - don't add ops if dst and src layouts are same
- Custom step - use Output<Node> instead of shared_ptr<Node>
- Support of addressing input by tensor name

Post-process:
- Avoid duplication of tensor names after post-processing

* Fixed IE tests
2021-10-08 12:58:29 +03:00
Mikhail Nosov e20cefb620 PrePostProcessor.output() - first implementation of post-processing (#7866)
* PrePostProcessor.output() - first implementation of post-processing
Supported convert_layout, convert_element_type and custom operations

* Fix review comments

* Added test for pre and post processing together
Fix clang-format

* Move 'validate_and_infer_types' before post-processing
2021-10-06 21:17:10 +03:00
Mikhail Nosov f57dc05c66 [OV20] Convert NV12 to RGB operation + preprocessing (#7508)
* # Conflicts:
#	docs/template_plugin/tests/functional/op_reference/convert_color_nv12.cpp
#	inference-engine/tests/functional/plugin/cpu/shared_tests_instances/single_layer_tests/convert_color_nv12.cpp
#	inference-engine/tests/functional/shared_test_classes/include/shared_test_classes/single_layer/convert_color_nv12.hpp
#	inference-engine/tests/functional/shared_test_classes/src/single_layer/convert_color_nv12.cpp
#	ngraph/core/include/openvino/core/preprocess/input_tensor_info.hpp
#	ngraph/core/include/openvino/core/preprocess/preprocess_steps.hpp
#	ngraph/core/include/openvino/op/nv12_to_bgr.hpp
#	ngraph/core/include/openvino/op/nv12_to_rgb.hpp
#	ngraph/core/src/op/nv12_to_bgr.cpp
#	ngraph/core/src/op/nv12_to_rgb.cpp
#	ngraph/core/src/preprocess/pre_post_process.cpp
#	ngraph/core/src/preprocess/preprocess_steps_impl.hpp
#	ngraph/test/CMakeLists.txt

* Added more test to cover 100% of code
Allow convert element type for 'multi-plane' color format

* Inherit tensor names for 'convert_color'

* Clang

* Fix tests

* Disable 'int8' preprocessing resize test

* Fix review comments

* Add more restrictions and tests for planes sub-names

* 1) Added check for uniqueness of tensor names generated for nodes
Raise error if user's plane sub-name conflicts with some node in a function
2) Added exception safety to preprocess build. Before, when input #2 fail, only one preprocess will be applied to function and it will be corrupted
Exception guard will restore function to original state if exception occurs

* Fix clang-format
2021-10-06 15:22:05 +03:00
Mikhail Nosov f8ed195841 Fix 'NV12 batch case' (was sporadic failure) (#7790)
Introduced 'absolute threshold' for LayerTests and BaseReferenceTests to consistently catch absolute differences
Previously, when set 'threshold=1.f' it was treated as 'allowed difference is 100%", so there was no way to allow absolute difference as 1.f
2021-10-01 20:21:52 +03:00
Mikhail Nosov 5b39e407d9 [OV2.0] Preprocessing - add 'convert_layout' (#7772)
* Preprocessing - add 'convert_layout'

* Fix comments, removed 'set_data_shape' for time being
2021-10-01 19:45:40 +03:00
Mikhail Nosov a883b5c097 Temporary disable sporadically failed test (PR #7601) (#7782)
* Temporary disable sporadically failed test

* Looks like skip test config didn't skip the test
2021-10-01 10:25:08 +03:00
Mikhail Nosov 6e05cead11 [OV20] Reference implementation for NV12toRGB and NV12toBGR operations (#7601)
* Reference implementation for NV12toRGB and NV12toBGR operations
Tests:
- ngraph: visitor + type_prop
- template plugin: reference implementation
- inference-engine: shared tests for plugins
- cpu plugin: compare with ref implementation tests

* Fix clang

* Serialization tests

* Fix clang-format

* Changed 'f32' to 'any supported floating-point type'
Added appropriate shape inference tests
Added error test for >2 inputs
Fixed failed CI tests

* Updates after rebase
+ Try to fix Ninja build

* Fix CI

* Support endianness + potential fix of win32 test fails

* Fix review comment

* Fix review comments

* Fix unit test build

* Fix unit test build #2

* Possible build fix 3

* Simplified reference tests
Observed issue with shuffling Y pixels on little-endian systems, added tests
2021-09-30 16:34:46 +03:00
Mikhail Nosov 414c3dc133 [OV2.0] Preprocessing - resize (#7583)
* Initial version

* Added 'network' layout to preprocessing info
Moved existing resize tests to template plugin

* Fix clang

* More tests for 'resize' reference implementation + CPU tests + error cases
Coverage is 100%

* Align with new base_reference_test implementation

* Fixed comments

* Add assert to check that desired size is not out of bounds

* CPU: skip failed test
2021-09-30 11:41:25 +03:00
Mikhail Nosov 4fd59f72ea Use 'u8' element type in tests (#7704)
Use 'float32' output for 'compare with reference' tests to avoid IE precisions undesired conversions
Added GPU preprocessing tests skeleton
2021-09-29 09:46:37 +03:00
Mikhail Nosov 4a49fb6e59 Fix potential UNITY build failures (ENABLE_FASTER_BUILD) (#7647)
When ENABLE_FASTER_BUILD is ON, source files are combined to batch for faster compilation.
However, when one source file uses "using namespace ngraph", and another has "using namespace ov" - then conflicts may occur depending on how sources were combined

This fix removes usage of "using namespace ov" from ngraph code to avoid such potential issues
2021-09-25 00:47:28 +03:00
Mikhail NosovandTatiana Savina ce9a229313 [OV20] NV12toRGB and NV12toBGR operations specification (#7595)
* [OV20] NV12toRGB and NV12toBGR operations specification

* Changed supported type to "`uint8` or any supported floating-point type"

* Apply suggestions from code review

Co-authored-by: Tatiana Savina <tatiana.savina@intel.com>

Co-authored-by: Tatiana Savina <tatiana.savina@intel.com>
2021-09-24 13:02:15 +03:00
Mikhail Nosov 531118c4b0 OV2.0 Preprocessing shared tests - initial version (#7568)
* Shared preprocessing tests for plugins.
Comparing inference with reference implementation

* Moved evaluate tests to template plugin

* Fixed clang-style

* CPU tests: Set IE precision manually in SetUp. Also allow rounding to integer mismatch

* Added acceptable threshold depending on particular test
2021-09-23 23:17:59 +03:00
Mikhail Nosov be8600af38 [OV20] ov::Layout improvements (#7551)
* Fix leftovers for ov::Layout
Added runtime info to Tensor
Add get_layout/set_layout/has_layout methods for parameter
Moved preprocess steps code to separate CPP file for readability purposes
Test code coverage = 100%

* Fixed review comments

* Try fix windows build

* Fix 1:
Correction: Dynamic channels dimension is ok on preprocessing
[?,?,?,?], Layout "NCHW" => scale({2.0, 3.0, 4.0}) is ok.
If HostTensor's channels dimension mismatches - it will fail on 'evaluate' stage (as usual)

Fix 2:
Verify that TensorInfo().set_layout(...) reuses element type from original parameter

* Removed 'using RTMap'
2021-09-21 16:02:55 +03:00
Mikhail Nosov 2236c6105b [OV20] Layout class implementation - basic API (#7452)
* Draft

* More tests

* to_string + advanced_syntax + more tests

* Coding style

* Add mean/scale - vector version with layout support

Vector version requires layout to be set

* Added comments to LayoutRank

* Removed unnecessary public API
- Removed setters
- Removed LayoutRank from public classes

* Review comments:
- Rename 'layouts' namespace to 'layout'
- 'get_index_by_name' - specify throw exception type
2021-09-13 19:02:22 +03:00
Mikhail Nosov 3f44858971 Fix 'preprocess' test compilation (#7423) 2021-09-08 16:10:06 +03:00