NMS-4 op support (#1115)
authorEvgeny Lazarev <evgeny.lazarev@intel.com>
Tue, 30 Jun 2020 11:04:31 +0000 (14:04 +0300)
committerGitHub <noreply@github.com>
Tue, 30 Jun 2020 11:04:31 +0000 (14:04 +0300)
commitf59643226865a92a9591068239bce62cacdbfe06
treed2d0a90e27700b7f036930a357db79b5c793e799
parenta01b91585742206cfe3e0560ca1bc3047a51d774
NMS-4 op support (#1115)

* Specification for the NMS-4 operation (updated shape infer function)

* Enabled NMS-4 in the Model Optimizer

* Changed opset version for NMS with dynamic outputs and namespace to be "dynamic"

* Added NMS-4

* Added opset4 to the nGraph

* Added unit tests for NMS-4 type infer

* Renamed UpgradeNMS3ToNMS4 to UpgradeNMS3ToNMSDynamic. Added stub for ConvertNMS4ToLegacy

* Make IE aware of opset4 ops

* Updated NMSIE to have different shape infer function based on the NMS it was converted from. Implemented NMS4->NMSIE conversion

* Apply code style

* Updated StaticShapeNonMaximumSuppression op in the VPU

* Introduced new version of NMSIE operation with shape infer function from v4::NMS

* Fixed dynamicToStaticNonMaxSuppression transformation

* Added new version of NMSIE op with updated shape infer function

* Fixed NMS4 to NMSIE2 transformation

* Fixed constructors for nGraph ops v4::NM and dynamic::NMS

* Updated text in the opset4 specification document

* Code style fixes

* Fixed constructors for StaticShapeNMS + fixed test

* Minor change to the NMS op in the MO

* Fixed typo in the dynamic_to_static_shape_non_max_suppression transformation

* Removed redundant checks

* Refactored NMS infer and validate functions

* Added more checks to the validate_and_infer_types functions for NMS-3 and NMS-4

* Fixed compilation issue on Windows for op NMS

* Code style fixes

* Fixed typos in the NMSIE and NMSIE2 to CNNLayer op conversion

* Fixed typo in the ie_cnn_layer_builder_ngraph.cpp

* Fixed the NMSToLegacyNMS transformation. Added unit tests

* Apply code review comments

* Refactored NMSIE to use visitors

* Removed calling ConvertNMS4ToLegacy in the common optimizations

* Moved NMS4ToNMSLegacy to convert1_to_legacy group of transformations

* Removed useless include statement

* Removed copy-paste issue

Co-authored-by: Evgeny Lazarev <elazarev.nnov@gmail.com>
36 files changed:
docs/ops/opset.md
docs/ops/opset4.md [new file with mode: 0644]
docs/ops/sort/NonMaxSuppression_4.md [new file with mode: 0644]
inference-engine/src/inference_engine/ie_core.cpp
inference-engine/src/legacy_api/src/convert_function_to_cnn_network.cpp
inference-engine/src/legacy_api/src/ie_cnn_layer_builder_ngraph.cpp
inference-engine/src/readers/ir_reader/ie_ir_parser.cpp
inference-engine/src/transformations/include/ngraph_ops/nms_ie.hpp
inference-engine/src/transformations/include/transformations/common_optimizations/common_optimizations_tbl.hpp
inference-engine/src/transformations/include/transformations/convert_nms_4_to_nms_dynamic.hpp [moved from inference-engine/src/transformations/include/transformations/convert_nms_3_to_nms_v4.hpp with 53% similarity]
inference-engine/src/transformations/include/transformations/convert_opset1_to_legacy/convert_nms_4_to_legacy.hpp [new file with mode: 0644]
inference-engine/src/transformations/include/transformations/convert_opset1_to_legacy/convert_opset1_to_legacy_tbl.hpp
inference-engine/src/transformations/src/ngraph_ops/nms_ie.cpp
inference-engine/src/transformations/src/transformations/common_optimizations/common_optimizations.cpp
inference-engine/src/transformations/src/transformations/convert_nms_3_to_nms_4.cpp [deleted file]
inference-engine/src/transformations/src/transformations/convert_nms_4_to_nms_dynamic.cpp [new file with mode: 0644]
inference-engine/src/transformations/src/transformations/convert_opset1_to_legacy/convert_nms_4_to_legacy.cpp [new file with mode: 0644]
inference-engine/src/transformations/src/transformations/convert_opset1_to_legacy/convert_opset1_to_legacy.cpp
inference-engine/src/vpu/common/include/vpu/ngraph/operations/static_shape_non_maximum_suppression.hpp
inference-engine/src/vpu/common/src/ngraph/operations/static_shape_non_maximum_suppression.cpp
inference-engine/src/vpu/common/src/ngraph/transformations/dynamic_to_static_shape.cpp
inference-engine/src/vpu/common/src/ngraph/transformations/dynamic_to_static_shape_non_max_suppression.cpp
inference-engine/tests/functional/inference_engine/transformations/convert_nms4_test.cpp [new file with mode: 0644]
inference-engine/tests/functional/plugin/myriad/ngraph/transformations/dynamic_to_static_shape_non_max_suppression.cpp
inference-engine/tests/functional/plugin/myriad/subgraph_tests/dsr_non_max_suppression.cpp
model-optimizer/extensions/ops/non_max_suppression.py
model-optimizer/extensions/ops/non_max_suppression_test.py
ngraph/python/src/ngraph/utils/node_factory.py
ngraph/python/src/pyngraph/node_factory.cpp
ngraph/src/ngraph/op/non_max_suppression.cpp
ngraph/src/ngraph/op/non_max_suppression.hpp
ngraph/src/ngraph/opsets/opset.cpp
ngraph/src/ngraph/opsets/opset.hpp
ngraph/src/ngraph/opsets/opset4.hpp [new file with mode: 0644]
ngraph/src/ngraph/opsets/opset4_tbl.hpp [new file with mode: 0644]
ngraph/test/type_prop/non_max_suppression.cpp