diff --git a/inference-engine/src/mkldnn_plugin/nodes/mkldnn_matrix_nms.cpp b/inference-engine/src/mkldnn_plugin/nodes/mkldnn_matrix_nms_node.cpp similarity index 99% rename from inference-engine/src/mkldnn_plugin/nodes/mkldnn_matrix_nms.cpp rename to inference-engine/src/mkldnn_plugin/nodes/mkldnn_matrix_nms_node.cpp index fd080d1d72a79d..89917792cd182a 100644 --- a/inference-engine/src/mkldnn_plugin/nodes/mkldnn_matrix_nms.cpp +++ b/inference-engine/src/mkldnn_plugin/nodes/mkldnn_matrix_nms_node.cpp @@ -510,4 +510,3 @@ void MKLDNNMatrixNmsNode::checkOutput(const SizeVector& dims, const std::vector< } REG_MKLDNN_PRIM_FOR(MKLDNNMatrixNmsNode, MatrixNms); - diff --git a/inference-engine/tests/functional/inference_engine/serialization/single_layer/matrix_nms.cpp b/inference-engine/tests/functional/inference_engine/serialization/single_layer/matrix_nms.cpp index d127db104c75e3..f45f4f1364cd0d 100644 --- a/inference-engine/tests/functional/inference_engine/serialization/single_layer/matrix_nms.cpp +++ b/inference-engine/tests/functional/inference_engine/serialization/single_layer/matrix_nms.cpp @@ -19,8 +19,6 @@ namespace { InferenceEngine::Precision::FP16 }; - /* ============= NO MAX SUPPRESSION ============= */ - const std::vector inShapeParams = { InputShapeParams{3, 100, 5}, InputShapeParams{1, 10, 50}, @@ -30,24 +28,31 @@ namespace { const std::vector sortResultType = {op::v8::MatrixNms::SortResultType::CLASSID, op::v8::MatrixNms::SortResultType::SCORE, op::v8::MatrixNms::SortResultType::NONE}; - const std::vector sortResultAcrossBatch = {true, false}; const std::vector outType = {element::i32, element::i64}; - const std::vector nmsTopK = {10, 100}; - const std::vector keepTopK = {10, 5}; + const std::vector topKParams = { + {-1, 5}, + {100, -1} + }; + const std::vector thresholdParams = { + {0.0f, 2.0f, 0.0f}, + {0.1f, 1.5f, 0.2f} + }; + const std::vector nmsTopK = {-1, 100}; + const std::vector keepTopK = {-1, 5}; const std::vector backgroudClass = {-1, 0}; + const std::vector normalized = {true, false}; const std::vector decayFunction = {op::v8::MatrixNms::DecayFunction::GAUSSIAN, op::v8::MatrixNms::DecayFunction::LINEAR}; - const auto nmsParams = ::testing::Combine(::testing::ValuesIn(inShapeParams), ::testing::Combine(::testing::Values(InferenceEngine::Precision::FP32), ::testing::Values(InferenceEngine::Precision::I32), ::testing::Values(InferenceEngine::Precision::FP32)), ::testing::ValuesIn(sortResultType), - ::testing::ValuesIn(sortResultAcrossBatch), ::testing::ValuesIn(outType), - ::testing::ValuesIn(nmsTopK), - ::testing::ValuesIn(keepTopK), + ::testing::ValuesIn(topKParams), + ::testing::ValuesIn(thresholdParams), ::testing::ValuesIn(backgroudClass), + ::testing::ValuesIn(normalized), ::testing::ValuesIn(decayFunction), ::testing::Values(CommonTestUtils::DEVICE_CPU)); diff --git a/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/single_layer_tests/matrix_nms.cpp b/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/single_layer_tests/matrix_nms.cpp index 915f5f51d8cfe8..78c7a458ef85b7 100644 --- a/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/single_layer_tests/matrix_nms.cpp +++ b/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/single_layer_tests/matrix_nms.cpp @@ -21,11 +21,19 @@ const std::vector inShapeParams = { const std::vector sortResultType = {op::v8::MatrixNms::SortResultType::CLASSID, op::v8::MatrixNms::SortResultType::SCORE, op::v8::MatrixNms::SortResultType::NONE}; -const std::vector sortResultAcrossBatch = {true, false}; const std::vector outType = {element::i32, element::i64}; +const std::vector topKParams = { + {-1, 5}, + {100, -1} +}; +const std::vector thresholdParams = { + {0.0f, 2.0f, 0.0f}, + {0.1f, 1.5f, 0.2f} +}; const std::vector nmsTopK = {-1, 100}; const std::vector keepTopK = {-1, 5}; const std::vector backgroudClass = {-1, 0}; +const std::vector normalized = {true, false}; const std::vector decayFunction = {op::v8::MatrixNms::DecayFunction::GAUSSIAN, op::v8::MatrixNms::DecayFunction::LINEAR}; @@ -34,11 +42,11 @@ const auto nmsParams = ::testing::Combine(::testing::ValuesIn(inShapeParams), ::testing::Values(Precision::I32), ::testing::Values(Precision::FP32)), ::testing::ValuesIn(sortResultType), - ::testing::ValuesIn(sortResultAcrossBatch), ::testing::ValuesIn(outType), - ::testing::ValuesIn(nmsTopK), - ::testing::ValuesIn(keepTopK), + ::testing::ValuesIn(topKParams), + ::testing::ValuesIn(thresholdParams), ::testing::ValuesIn(backgroudClass), + ::testing::ValuesIn(normalized), ::testing::ValuesIn(decayFunction), ::testing::Values(CommonTestUtils::DEVICE_CPU) ); diff --git a/inference-engine/tests/functional/shared_test_classes/include/shared_test_classes/single_layer/matrix_nms.hpp b/inference-engine/tests/functional/shared_test_classes/include/shared_test_classes/single_layer/matrix_nms.hpp index 23cad1827b74a9..27a0892164df5e 100644 --- a/inference-engine/tests/functional/shared_test_classes/include/shared_test_classes/single_layer/matrix_nms.hpp +++ b/inference-engine/tests/functional/shared_test_classes/include/shared_test_classes/single_layer/matrix_nms.hpp @@ -20,14 +20,21 @@ using InputPrecisions = std::tuple; // iou_threshold, score_threshold, soft_nms_sigma precisions +using TopKParams = std::tuple; // Maximum number of boxes to be selected per batch element + +using ThresholdParams = std::tuple; // filter out boxes with low confidence score after decaying + using NmsParams = std::tuple; // Device name diff --git a/inference-engine/tests/functional/shared_test_classes/src/single_layer/matrix_nms.cpp b/inference-engine/tests/functional/shared_test_classes/src/single_layer/matrix_nms.cpp index 0b5ee35eaae4bc..2b33a25ae1e764 100644 --- a/inference-engine/tests/functional/shared_test_classes/src/single_layer/matrix_nms.cpp +++ b/inference-engine/tests/functional/shared_test_classes/src/single_layer/matrix_nms.cpp @@ -14,13 +14,15 @@ std::string MatrixNmsLayerTest::getTestCaseName(testing::TestParamInfoGetParam(); + TopKParams topKParams; + ThresholdParams thresholdParams; + std::tie(inShapeParams, inPrecisions, attrs.sort_result_type, attrs.output_type, topKParams, thresholdParams, + attrs.background_class, attrs.normalized, attrs.decay_function, targetDevice) = this->GetParam(); + std::tie(attrs.nms_top_k, attrs.keep_top_k) = topKParams; + std::tie(attrs.score_threshold, attrs.gaussian_sigma, attrs.post_threshold) = thresholdParams; std::tie(numBatches, numBoxes, numClasses) = inShapeParams; auto realClasses = numClasses; if (attrs.background_class >=0 && attrs.background_class <= numClasses) {