diff --git a/docs/template_plugin/backend/evaluates_map.cpp b/docs/template_plugin/backend/evaluates_map.cpp index dfa74b9fb82ed0..cee732e9bba204 100644 --- a/docs/template_plugin/backend/evaluates_map.cpp +++ b/docs/template_plugin/backend/evaluates_map.cpp @@ -2112,11 +2112,11 @@ bool evaluate(const shared_ptr& op const HostTensorVector& outputs, const HostTensorVector& inputs) { const auto attrs = op->get_attrs(); - const size_t output_roi_count = attrs.max_detections_per_image; + size_t rois_num = attrs.max_detections_per_image; - const Shape output_boxes_shape = Shape{output_roi_count, 4}; - const Shape output_classes_shape = Shape{output_roi_count}; - const Shape output_scores_shape = Shape{output_roi_count}; + const Shape output_boxes_shape = Shape{rois_num, 4}; + const Shape output_classes_shape = Shape{rois_num}; + const Shape output_scores_shape = Shape{rois_num}; const auto output_type = op->get_input_element_type(0); @@ -2124,7 +2124,6 @@ bool evaluate(const shared_ptr& op const auto input_deltas_data = get_floats(inputs[1], inputs[1]->get_shape()); const auto input_scores_data = get_floats(inputs[2], inputs[2]->get_shape()); const auto input_im_info_data = get_floats(inputs[3], inputs[3]->get_shape()); - const auto input_roi_count = inputs[0]->get_shape()[0]; std::vector output_boxes(shape_size(output_boxes_shape)); std::vector output_classes(shape_size(output_classes_shape)); @@ -2141,7 +2140,6 @@ bool evaluate(const shared_ptr& op input_deltas_data.data(), input_scores_data.data(), input_im_info_data.data(), - input_roi_count, attrs, output_boxes.data(), output_scores.data(), diff --git a/docs/template_plugin/tests/functional/op_reference/experimental_detectron_detection_output.cpp b/docs/template_plugin/tests/functional/op_reference/experimental_detectron_detection_output.cpp index 0a64e59f25942d..0f5841fc32172e 100644 --- a/docs/template_plugin/tests/functional/op_reference/experimental_detectron_detection_output.cpp +++ b/docs/template_plugin/tests/functional/op_reference/experimental_detectron_detection_output.cpp @@ -2,10 +2,9 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "openvino/op/experimental_detectron_detection_output.hpp" - #include +#include "openvino/op/experimental_detectron_detection_output.hpp" #include "base_reference_test.hpp" using namespace reference_tests; @@ -19,13 +18,9 @@ struct ExperimentalDOParams { ExperimentalDOParams(const Attrs& attrs, const size_t num_rois, const element::Type& iType, - const std::vector& roisValues, - const std::vector& deltasValues, - const std::vector& scoresValues, - const std::vector& imageSizeInfoValues, - const std::vector& refBoxesValues, - const std::vector& refClassesValues, - const std::vector& refScoresValues, + const std::vector& roisValues, const std::vector& deltasValues, + const std::vector& scoresValues, const std::vector& imageSizeInfoValues, + const std::vector& refBoxesValues, const std::vector& refClassesValues, const std::vector& refScoresValues, const std::string& testcaseName = "") : attrs(attrs), inType(iType), @@ -38,11 +33,11 @@ struct ExperimentalDOParams { refClassesData(CreateTensor(ov::element::i32, refClassesValues)), refScoresData(CreateTensor(iType, refScoresValues)), testcaseName(testcaseName) { - roisShape = Shape{num_rois, 4}; - deltasShape = Shape{num_rois, static_cast(attrs.num_classes * 4)}; - scoresShape = Shape{num_rois, static_cast(attrs.num_classes)}; - imageSizeInfoShape = Shape{1, 3}; - } + roisShape = Shape{num_rois, 4}; + deltasShape = Shape{num_rois, static_cast(attrs.num_classes * 4)}; + scoresShape = Shape{num_rois, static_cast(attrs.num_classes)}; + imageSizeInfoShape = Shape{1, 3}; + } Attrs attrs; PartialShape roisShape; @@ -61,8 +56,7 @@ struct ExperimentalDOParams { std::string testcaseName; }; -class ReferenceExperimentalDOLayerTest : public testing::TestWithParam, - public CommonReferenceTest { +class ReferenceExperimentalDOLayerTest : public testing::TestWithParam, public CommonReferenceTest { public: void SetUp() override { auto params = GetParam(); @@ -90,9 +84,12 @@ class ReferenceExperimentalDOLayerTest : public testing::TestWithParam(params.inType, params.deltasShape); const auto scores = std::make_shared(params.inType, params.scoresShape); const auto im_info = std::make_shared(params.inType, params.imageSizeInfoShape); - const auto ExperimentalDO = - std::make_shared(rois, deltas, scores, im_info, params.attrs); - return std::make_shared(ExperimentalDO->outputs(), ParameterVector{rois, deltas, scores, im_info}); + const auto ExperimentalDO = std::make_shared(rois, + deltas, + scores, + im_info, + params.attrs); + return std::make_shared(ExperimentalDO->outputs(), ParameterVector {rois, deltas, scores, im_info}); } }; @@ -104,54 +101,68 @@ template std::vector generateExperimentalDOFloatParams() { using T = typename element_type_traits::value_type; - std::vector experimentalDOParams{ - ExperimentalDOParams( - Attrs{ - 0.01000000074505806f, // score_threshold - 0.2f, // nms_threshold - 2.0f, // max_delta_log_wh - 2, // num_classes - 500, // post_nms_count - 5, // max_detections_per_image - true, // class_agnostic_box_regression - {10.0f, 10.0f, 5.0f, 5.0f} // deltas_weights - }, - 16, - IN_ET, - std::vector{1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 4.0f, - 1.0f, 8.0f, 5.0f, 1.0f, 1.0f, 10.0f, 10.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, - 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, - 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, - 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f}, - std::vector{1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 4.0f, 1.0f, 1.0f, - 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 8.0f, 1.0f, 1.0f, 1.0f, - 1.0f, 1.0f, 5.0f, 1.0f, 1.0f, 1.0f, -1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, - 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, - 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, - 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, - 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, - 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, - 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f}, - - std::vector{0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.8f, 0.9f, 0.5f, - 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, - 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f}, - std::vector{16.0f, 12.0f, 1.0f}, - std::vector{4.8929863f, 0.892986298f, 12.0f, 12.1070137f, 0.0f, 0.892986298f, 10.1070137f, - 12.1070137f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}, - std::vector{0, 1, 0, 0, 0}, - std::vector{0.8f, 0.9f, 0.0f, 0.0f, 0.0f}), + std::vector experimentalDOParams { + ExperimentalDOParams(Attrs{0.01000000074505806f, // score_threshold + 0.2f, // nms_threshold + 2.0f, // max_delta_log_wh + 2, // num_classes + 500, // post_nms_count + 5, // max_detections_per_image + true, // class_agnostic_box_regression + {10.0f, 10.0f, 5.0f, 5.0f} // deltas_weights + }, + 16, +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 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, + 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f}, + std::vector{1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, + 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, + 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f}, + std::vector{1.0f, 1.0f, 1.0f}, + std::vector{0.8929862f, + 0.892986297607421875, + 12.10701370239257812, + 12.10701370239257812, + 0.0f, + 0.0f, + 0.0f, + 0.0f, + 0.0f, + 0.0f, + 0.0f, + 0.0f, + 0.0f, + 0.0f, + 0.0f, + 0.0f, + 0.0f, + 0.0f, + 0.0f, + 0.0}, + std::vector{1, 0, 0, 0, 0}, + std::vector{1.0f, 0.0f, 0.0f, 0.0f, 0.0f}), }; return experimentalDOParams; } std::vector generateExperimentalDOCombinedParams() { - const std::vector> ExperimentalDOTypeParams{ + const std::vector> ExperimentalDOTypeParams { generateExperimentalDOFloatParams(), generateExperimentalDOFloatParams(), generateExperimentalDOFloatParams(), - }; + }; std::vector combinedParams; for (const auto& params : ExperimentalDOTypeParams) { @@ -160,8 +171,6 @@ std::vector generateExperimentalDOCombinedParams() { return combinedParams; } -INSTANTIATE_TEST_SUITE_P(smoke_ExperimentalDetectronDetectionOutput_With_Hardcoded_Refs, - ReferenceExperimentalDOLayerTest, - testing::ValuesIn(generateExperimentalDOCombinedParams()), - ReferenceExperimentalDOLayerTest::getTestCaseName); -} // namespace +INSTANTIATE_TEST_SUITE_P(smoke_ExperimentalDetectronDetectionOutput_With_Hardcoded_Refs, ReferenceExperimentalDOLayerTest, + testing::ValuesIn(generateExperimentalDOCombinedParams()), ReferenceExperimentalDOLayerTest::getTestCaseName); +} // namespace diff --git a/src/core/reference/include/ngraph/runtime/reference/experimental_detectron_detection_output.hpp b/src/core/reference/include/ngraph/runtime/reference/experimental_detectron_detection_output.hpp index 0e57eace94f461..b2147fe9c461e8 100644 --- a/src/core/reference/include/ngraph/runtime/reference/experimental_detectron_detection_output.hpp +++ b/src/core/reference/include/ngraph/runtime/reference/experimental_detectron_detection_output.hpp @@ -34,7 +34,6 @@ void experimental_detectron_detection_output(const float* input_rois, const float* input_deltas, const float* input_scores, const float* input_im_info, - size_t roi_count, const op::v6::ExperimentalDetectronDetectionOutput::Attributes& attrs, float* output_boxes, float* output_scores, diff --git a/src/core/reference/src/runtime/reference/experimental_detectron_detection_output.cpp b/src/core/reference/src/runtime/reference/experimental_detectron_detection_output.cpp index 1edd600508254a..3de7f044ba84d0 100644 --- a/src/core/reference/src/runtime/reference/experimental_detectron_detection_output.cpp +++ b/src/core/reference/src/runtime/reference/experimental_detectron_detection_output.cpp @@ -54,7 +54,7 @@ void refine_boxes(const float* boxes, const float ctr_x = x0 + 0.5f * ww; const float ctr_y = y0 + 0.5f * hh; - for (int class_idx = 0; class_idx < classes_num; ++class_idx) { + for (int class_idx = 1; class_idx < classes_num; ++class_idx) { const int64_t deltas_base_offset = classes_num * 4 * roi_idx + 4 * class_idx; const float dx = deltas[deltas_base_offset + 0] / weights[0]; const float dy = deltas[deltas_base_offset + 1] / weights[1]; @@ -76,10 +76,10 @@ void refine_boxes(const float* boxes, float y1_new = pred_ctr_y + 0.5f * pred_h - coordinates_offset; // adjust new corner locations to be within the image region, - x0_new = std::min(std::max(0.0f, x0_new), img_W); - y0_new = std::min(std::max(0.0f, y0_new), img_H); - x1_new = std::min(std::max(0.0f, x1_new), img_W); - y1_new = std::min(std::max(0.0f, y1_new), img_H); + x0_new = std::max(0.0f, x0_new); + y0_new = std::max(0.0f, y0_new); + x1_new = std::max(0.0f, x1_new); + y1_new = std::max(0.0f, y1_new); // recompute new width & height const float box_w = x1_new - x0_new + coordinates_offset; @@ -214,7 +214,6 @@ void experimental_detectron_detection_output(const float* boxes, const float* input_deltas, const float* input_scores, const float* input_im_info, - size_t roi_count, const op::v6::ExperimentalDetectronDetectionOutput::Attributes& attrs, float* output_boxes, float* output_scores, @@ -222,7 +221,7 @@ void experimental_detectron_detection_output(const float* boxes, const float img_H = input_im_info[0]; const float img_W = input_im_info[1]; const int64_t classes_num = attrs.num_classes; - const int64_t rois_num = static_cast(roi_count); + const int64_t rois_num = static_cast(attrs.max_detections_per_image); const int64_t max_detections_per_image = static_cast(attrs.max_detections_per_image); const int64_t max_detections_per_class = attrs.post_nms_count; const float score_threshold = attrs.score_threshold; @@ -256,7 +255,7 @@ void experimental_detectron_detection_output(const float* boxes, std::vector detections_per_class(classes_num, 0); int64_t total_detections_num = 0; - for (int64_t class_idx = 0; class_idx < classes_num; ++class_idx) { + for (int64_t class_idx = 1; class_idx < classes_num; ++class_idx) { nms_cf(&refined_scores[rois_num * class_idx], &refined_boxes[rois_num * 4 * class_idx], &refined_boxes_areas[rois_num * class_idx], diff --git a/src/frontends/tests/onnx/onnx_import_org_openvino.in.cpp b/src/frontends/tests/onnx/onnx_import_org_openvino.in.cpp index d2ffe49c3ef987..cce55ce82800ae 100644 --- a/src/frontends/tests/onnx/onnx_import_org_openvino.in.cpp +++ b/src/frontends/tests/onnx/onnx_import_org_openvino.in.cpp @@ -272,34 +272,54 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_model_experimental_detectron_detection_output) auto test_case = test::TestCase(function, s_device); // rois - test_case.add_input({1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 4.0f, - 1.0f, 8.0f, 5.0f, 1.0f, 1.0f, 10.0f, 10.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, - 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f,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, 1.0f, + 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f}); // scores - test_case.add_input({0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.8f, 0.9f, 0.5f, - 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, - 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f}); + test_case.add_input({1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, + 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, + 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f}); // im_info - test_case.add_input({16.0f, 12.0f, 1.0f}); + test_case.add_input({1.0f, 1.0f, 1.0f}); - test_case.add_expected_output( - Shape{5, 4}, - {4.8929863f, 0.892986298f, 12.0f, 12.1070137f, 0.0f, 0.892986298f, 10.1070137f, 12.1070137f, 0.0f, 0.0f, - 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}); - test_case.add_expected_output(Shape{5}, {0, 1, 0, 0, 0}); - test_case.add_expected_output(Shape{5}, {0.8f, 0.9f, 0.0f, 0.0f, 0.0f}); + test_case.add_expected_output(Shape{5, 4}, + { + 0.8929862f, + 0.892986297607421875, + 12.10701370239257812, + 12.10701370239257812, + 0, + 0.0f, + 0.0f, + 0.0f, + 0.0f, + 0.0f, + 0.0f, + 0.0f, + 0.0f, + 0.0f, + 0.0f, + 0.0f, + 0.0f, + 0.0f, + 0.0f, + 0.0f, + }); + test_case.add_expected_output(Shape{5}, {1, 0, 0, 0, 0}); + test_case.add_expected_output(Shape{5}, {1.0f, 0.0f, 0.0f, 0.0f, 0.0f}); test_case.run(); } diff --git a/src/plugins/intel_cpu/src/nodes/experimental_detectron_detection_output.cpp b/src/plugins/intel_cpu/src/nodes/experimental_detectron_detection_output.cpp index 1d1505b0f638cf..8bdd20a9b743b6 100644 --- a/src/plugins/intel_cpu/src/nodes/experimental_detectron_detection_output.cpp +++ b/src/plugins/intel_cpu/src/nodes/experimental_detectron_detection_output.cpp @@ -2,13 +2,12 @@ // SPDX-License-Identifier: Apache-2.0 // -#include "experimental_detectron_detection_output.h" - -#include #include #include +#include #include "ie_parallel.hpp" +#include "experimental_detectron_detection_output.h" using namespace InferenceEngine; @@ -39,19 +38,13 @@ struct Indexer { } }; -static void refine_boxes(const float* boxes, - const float* deltas, - const float* weights, - const float* scores, - float* refined_boxes, - float* refined_boxes_areas, - float* refined_scores, - const int rois_num, - const int classes_num, - const float img_H, - const float img_W, - const float max_delta_log_wh, - float coordinates_offset) { +static +void refine_boxes(const float* boxes, const float* deltas, const float* weights, const float* scores, + float* refined_boxes, float* refined_boxes_areas, float* refined_scores, + const int rois_num, const int classes_num, + const float img_H, const float img_W, + const float max_delta_log_wh, + float coordinates_offset) { Indexer box_idx({rois_num, 4}); Indexer delta_idx({rois_num, classes_num, 4}); Indexer score_idx({rois_num, classes_num}); @@ -76,7 +69,7 @@ static void refine_boxes(const float* boxes, const float ctr_x = x0 + 0.5f * ww; const float ctr_y = y0 + 0.5f * hh; - for (int class_idx = 0; class_idx < classes_num; ++class_idx) { + for (int class_idx = 1; class_idx < classes_num; ++class_idx) { const float dx = deltas[delta_idx({roi_idx, class_idx, 0})] / weights[0]; const float dy = deltas[delta_idx({roi_idx, class_idx, 1})] / weights[1]; const float d_log_w = deltas[delta_idx({roi_idx, class_idx, 2})] / weights[2]; @@ -97,10 +90,10 @@ static void refine_boxes(const float* boxes, float y1_new = pred_ctr_y + 0.5f * pred_h - coordinates_offset; // adjust new corner locations to be within the image region, - x0_new = std::min(std::max(0.0f, x0_new), img_W); - y0_new = std::min(std::max(0.0f, y0_new), img_H); - x1_new = std::min(std::max(0.0f, x1_new), img_W); - y1_new = std::min(std::max(0.0f, y1_new), img_H); + x0_new = std::max(0.0f, x0_new); + y0_new = std::max(0.0f, y0_new); + x1_new = std::max(0.0f, x1_new); + y1_new = std::max(0.0f, y1_new); // recompute new width & height const float box_w = x1_new - x0_new + coordinates_offset; @@ -123,22 +116,21 @@ static bool SortScorePairDescend(const std::pair>& pa return (pair1.first > pair2.first) || ((pair1.first == pair2.first) && (pair1.second.second < pair2.second.second)); } + struct ConfidenceComparator { explicit ConfidenceComparator(const float* conf_data) : _conf_data(conf_data) {} bool operator()(int idx1, int idx2) { - if (_conf_data[idx1] > _conf_data[idx2]) - return true; - if (_conf_data[idx1] < _conf_data[idx2]) - return false; + if (_conf_data[idx1] > _conf_data[idx2]) return true; + if (_conf_data[idx1] < _conf_data[idx2]) return false; return idx1 < idx2; } const float* _conf_data; }; -static inline float JaccardOverlap(const float* decoded_bbox, - const float* bbox_sizes, +static inline float JaccardOverlap(const float *decoded_bbox, + const float *bbox_sizes, const int idx1, const int idx2, const float coordinates_offset = 1) { @@ -161,7 +153,7 @@ static inline float JaccardOverlap(const float* decoded_bbox, float intersect_xmax = (std::min)(xmax1, xmax2); float intersect_ymax = (std::min)(ymax1, ymax2); - float intersect_width = intersect_xmax - intersect_xmin + coordinates_offset; + float intersect_width = intersect_xmax - intersect_xmin + coordinates_offset; float intersect_height = intersect_ymax - intersect_ymin + coordinates_offset; if (intersect_width <= 0 || intersect_height <= 0) { @@ -175,6 +167,7 @@ static inline float JaccardOverlap(const float* decoded_bbox, return intersect_size / (bbox1_size + bbox2_size - intersect_size); } + static void nms_cf(const float* conf_data, const float* bboxes, const float* sizes, @@ -196,10 +189,8 @@ static void nms_cf(const float* conf_data, int num_output_scores = (pre_nms_topn == -1 ? count : (std::min)(pre_nms_topn, count)); - std::partial_sort_copy(indices, - indices + count, - buffer, - buffer + num_output_scores, + std::partial_sort_copy(indices, indices + count, + buffer, buffer + num_output_scores, ConfidenceComparator(conf_data)); detections = 0; @@ -232,13 +223,11 @@ bool ExperimentalDetectronDetectionOutput::needPrepareParams() const { return false; } -bool ExperimentalDetectronDetectionOutput::isSupportedOperation(const std::shared_ptr& op, - std::string& errorMessage) noexcept { +bool ExperimentalDetectronDetectionOutput::isSupportedOperation(const std::shared_ptr& op, std::string& errorMessage) noexcept { try { const auto doOp = ngraph::as_type_ptr(op); if (!doOp) { - errorMessage = - "Node is not an instance of the ExperimentalDetectronDetectionOutput from the operations set v6."; + errorMessage = "Node is not an instance of the ExperimentalDetectronDetectionOutput from the operations set v6."; return false; } } catch (...) { @@ -247,10 +236,9 @@ bool ExperimentalDetectronDetectionOutput::isSupportedOperation(const std::share return true; } -ExperimentalDetectronDetectionOutput::ExperimentalDetectronDetectionOutput(const std::shared_ptr& op, - const dnnl::engine& eng, - WeightsSharing::Ptr& cache) - : Node(op, eng, cache) { +ExperimentalDetectronDetectionOutput::ExperimentalDetectronDetectionOutput + (const std::shared_ptr& op, const dnnl::engine& eng, + WeightsSharing::Ptr &cache) : Node(op, eng, cache) { std::string errorMessage; if (!isSupportedOperation(op, errorMessage)) { IE_THROW(NotImplemented) << errorMessage; @@ -277,10 +265,11 @@ void ExperimentalDetectronDetectionOutput::initSupportedPrimitiveDescriptors() { for (int i = 0; i < inputShapes.size(); ++i) inDataConf.emplace_back(LayoutType::ncsp, Precision::FP32); - addSupportedPrimDesc( - inDataConf, - {{LayoutType::ncsp, Precision::FP32}, {LayoutType::ncsp, Precision::I32}, {LayoutType::ncsp, Precision::FP32}}, - impl_desc_type::ref_any); + addSupportedPrimDesc(inDataConf, + {{LayoutType::ncsp, Precision::FP32}, + {LayoutType::ncsp, Precision::I32}, + {LayoutType::ncsp, Precision::FP32}}, + impl_desc_type::ref_any); } void ExperimentalDetectronDetectionOutput::execute(dnnl::stream strm) { @@ -288,14 +277,14 @@ void ExperimentalDetectronDetectionOutput::execute(dnnl::stream strm) { assert(classes_num_ == static_cast(getParentEdgeAt(INPUT_SCORES)->getMemory().getStaticDims()[1])); assert(4 * classes_num_ == static_cast(getParentEdgeAt(INPUT_DELTAS)->getMemory().getStaticDims()[1])); - const auto* boxes = reinterpret_cast(getParentEdgeAt(INPUT_ROIS)->getMemoryPtr()->GetPtr()); - const auto* deltas = reinterpret_cast(getParentEdgeAt(INPUT_DELTAS)->getMemoryPtr()->GetPtr()); - const auto* scores = reinterpret_cast(getParentEdgeAt(INPUT_SCORES)->getMemoryPtr()->GetPtr()); - const auto* im_info = reinterpret_cast(getParentEdgeAt(INPUT_IM_INFO)->getMemoryPtr()->GetPtr()); + const auto* boxes = reinterpret_cast(getParentEdgeAt(INPUT_ROIS)->getMemoryPtr()->GetPtr()); + const auto* deltas = reinterpret_cast(getParentEdgeAt(INPUT_DELTAS)->getMemoryPtr()->GetPtr()); + const auto* scores = reinterpret_cast(getParentEdgeAt(INPUT_SCORES)->getMemoryPtr()->GetPtr()); + const auto* im_info = reinterpret_cast(getParentEdgeAt(INPUT_IM_INFO)->getMemoryPtr()->GetPtr()); - auto* output_boxes = reinterpret_cast(getChildEdgesAtPort(OUTPUT_BOXES)[0]->getMemoryPtr()->GetPtr()); - auto* output_scores = reinterpret_cast(getChildEdgesAtPort(OUTPUT_SCORES)[0]->getMemoryPtr()->GetPtr()); - auto* output_classes = reinterpret_cast(getChildEdgesAtPort(OUTPUT_CLASSES)[0]->getMemoryPtr()->GetPtr()); + auto* output_boxes = reinterpret_cast(getChildEdgesAtPort(OUTPUT_BOXES)[0]->getMemoryPtr()->GetPtr()); + auto* output_scores = reinterpret_cast(getChildEdgesAtPort(OUTPUT_SCORES)[0]->getMemoryPtr()->GetPtr()); + auto* output_classes = reinterpret_cast(getChildEdgesAtPort(OUTPUT_CLASSES)[0]->getMemoryPtr()->GetPtr()); const float img_H = im_info[0]; const float img_W = im_info[1]; @@ -307,17 +296,10 @@ void ExperimentalDetectronDetectionOutput::execute(dnnl::stream strm) { Indexer refined_box_idx({classes_num_, rois_num, 4}); Indexer refined_score_idx({classes_num_, rois_num}); - refine_boxes(boxes, - deltas, - &deltas_weights_[0], - scores, - &refined_boxes[0], - &refined_boxes_areas[0], - &refined_scores[0], - rois_num, - classes_num_, - img_H, - img_W, + refine_boxes(boxes, deltas, &deltas_weights_[0], scores, + &refined_boxes[0], &refined_boxes_areas[0], &refined_scores[0], + rois_num, classes_num_, + img_H, img_W, max_delta_log_wh_, 1.0f); @@ -327,7 +309,7 @@ void ExperimentalDetectronDetectionOutput::execute(dnnl::stream strm) { std::vector detections_per_class(classes_num_, 0); int total_detections_num = 0; - for (int class_idx = 0; class_idx < classes_num_; ++class_idx) { + for (int class_idx = 1; class_idx < classes_num_; ++class_idx) { nms_cf(&refined_scores[refined_score_idx({class_idx, 0})], &refined_boxes[refined_box_idx({class_idx, 0, 0})], &refined_boxes_areas[refined_score_idx({class_idx, 0})], @@ -373,7 +355,7 @@ void ExperimentalDetectronDetectionOutput::execute(dnnl::stream strm) { memset(output_classes, 0, max_detections_per_image_ * sizeof(output_classes[0])); int i = 0; - for (const auto& detection : conf_index_class_map) { + for (const auto & detection : conf_index_class_map) { float score = detection.first; int cls = detection.second.first; int idx = detection.second.second; @@ -391,6 +373,6 @@ bool ExperimentalDetectronDetectionOutput::created() const { return getType() == Type::ExperimentalDetectronDetectionOutput; } -} // namespace node -} // namespace intel_cpu -} // namespace ov +} // namespace node +} // namespace intel_cpu +} // namespace ov diff --git a/src/tests/functional/plugin/gpu/shared_tests_instances/single_layer_tests/experimental_detectron_detection_output.cpp b/src/tests/functional/plugin/gpu/shared_tests_instances/single_layer_tests/experimental_detectron_detection_output.cpp index 4a1a4b8b67af91..0153b4dc61fb00 100644 --- a/src/tests/functional/plugin/gpu/shared_tests_instances/single_layer_tests/experimental_detectron_detection_output.cpp +++ b/src/tests/functional/plugin/gpu/shared_tests_instances/single_layer_tests/experimental_detectron_detection_output.cpp @@ -47,7 +47,7 @@ const std::vector> inputShapes = { static_shapes_to_test_representation({{16, 4}, {16, 8}, {16, 2}, {1, 3}}), }; -INSTANTIATE_TEST_SUITE_P(smoke_ExperimentalDetectronDetectionOutput, +INSTANTIATE_TEST_SUITE_P(DISABLED_smoke_ExperimentalDetectronDetectionOutput, ExperimentalDetectronDetectionOutputLayerTest, ::testing::Combine(::testing::ValuesIn(inputShapes), ::testing::ValuesIn(score_threshold), diff --git a/src/tests/functional/shared_test_classes/src/single_layer/experimental_detectron_detection_output.cpp b/src/tests/functional/shared_test_classes/src/single_layer/experimental_detectron_detection_output.cpp index de81d356673356..41b3b8c1cced30 100644 --- a/src/tests/functional/shared_test_classes/src/single_layer/experimental_detectron_detection_output.cpp +++ b/src/tests/functional/shared_test_classes/src/single_layer/experimental_detectron_detection_output.cpp @@ -3,19 +3,16 @@ // #include "shared_test_classes/single_layer/experimental_detectron_detection_output.hpp" - -#include - -#include "common_test_utils/data_utils.hpp" #include "ngraph_functions/builders.hpp" +#include "common_test_utils/data_utils.hpp" +#include namespace ov { namespace test { namespace subgraph { namespace { -std::ostream& operator<<(std::ostream& ss, - const ngraph::opset6::ExperimentalDetectronDetectionOutput::Attributes& attributes) { + std::ostream& operator <<(std::ostream& ss, const ngraph::opset6::ExperimentalDetectronDetectionOutput::Attributes& attributes) { ss << "score_threshold=" << attributes.score_threshold << "_"; ss << "nms_threshold=" << attributes.nms_threshold << "_"; ss << "max_delta_log_wh=" << attributes.max_delta_log_wh << "_"; @@ -26,25 +23,26 @@ std::ostream& operator<<(std::ostream& ss, ss << "deltas_weights=" << CommonTestUtils::vec2str(attributes.deltas_weights); return ss; } -} // namespace +} // namespace std::string ExperimentalDetectronDetectionOutputLayerTest::getTestCaseName( - const testing::TestParamInfo& obj) { + const testing::TestParamInfo& obj) { std::vector inputShapes; ngraph::opset6::ExperimentalDetectronDetectionOutput::Attributes attributes; ElementType netPrecision; std::string targetName; - std::tie(inputShapes, - attributes.score_threshold, - attributes.nms_threshold, - attributes.max_delta_log_wh, - attributes.num_classes, - attributes.post_nms_count, - attributes.max_detections_per_image, - attributes.class_agnostic_box_regression, - attributes.deltas_weights, - netPrecision, - targetName) = obj.param; + std::tie( + inputShapes, + attributes.score_threshold, + attributes.nms_threshold, + attributes.max_delta_log_wh, + attributes.num_classes, + attributes.post_nms_count, + attributes.max_detections_per_image, + attributes.class_agnostic_box_regression, + attributes.deltas_weights, + netPrecision, + targetName) = obj.param; std::ostringstream result; @@ -67,17 +65,18 @@ void ExperimentalDetectronDetectionOutputLayerTest::SetUp() { ElementType netPrecision; std::string targetName; - std::tie(inputShapes, - attributes.score_threshold, - attributes.nms_threshold, - attributes.max_delta_log_wh, - attributes.num_classes, - attributes.post_nms_count, - attributes.max_detections_per_image, - attributes.class_agnostic_box_regression, - attributes.deltas_weights, - netPrecision, - targetName) = this->GetParam(); + std::tie( + inputShapes, + attributes.score_threshold, + attributes.nms_threshold, + attributes.max_delta_log_wh, + attributes.num_classes, + attributes.post_nms_count, + attributes.max_detections_per_image, + attributes.class_agnostic_box_regression, + attributes.deltas_weights, + netPrecision, + targetName) = this->GetParam(); if (netPrecision == element::f16) abs_threshold = 0.01; @@ -88,74 +87,49 @@ void ExperimentalDetectronDetectionOutputLayerTest::SetUp() { init_input_shapes(inputShapes); auto params = ngraph::builder::makeDynamicParams(netPrecision, {inputDynamicShapes}); - auto paramsOuts = - ngraph::helpers::convert2OutputVector(ngraph::helpers::castOps2Nodes(params)); - auto experimentalDetectron = - std::make_shared(params[0], // input_rois - params[1], // input_deltas - params[2], // input_scores - params[3], // input_im_info - attributes); - function = std::make_shared(ov::OutputVector{experimentalDetectron->output(0), - experimentalDetectron->output(1), - experimentalDetectron->output(2)}, - "ExperimentalDetectronDetectionOutput"); -} - -namespace { - -template -std::vector getValues(const std::vector& values) { - std::vector result(values.begin(), values.end()); - return result; + auto paramsOuts = ngraph::helpers::convert2OutputVector(ngraph::helpers::castOps2Nodes(params)); + auto experimentalDetectron = std::make_shared( + params[0], // input_rois + params[1], // input_deltas + params[2], // input_scores + params[3], // input_im_info + attributes); + function = std::make_shared( + ov::OutputVector{experimentalDetectron->output(0), experimentalDetectron->output(1)}, + "ExperimentalDetectronDetectionOutput"); } -template -std::vector generateInputTensors() { - const auto netPrecision = ov::element::from(); - std::vector inputTensors = { +void ExperimentalDetectronDetectionOutputLayerTest::generate_inputs(const std::vector& targetInputStaticShapes) { + static const std::vector inputTensors = { // 16 x 4 = 64 - ov::test::utils::create_tensor( - netPrecision, - Shape{16, 4}, - getValues({1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 4.0f, - 1.0f, 8.0f, 5.0f, 1.0f, 1.0f, 10.0f, 10.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, - 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, - 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, - 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f})), + ov::test::utils::create_tensor(ov::element::f32, Shape{16, 4}, { + 1.0f, 1.0f, 10.0f, 10.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, + 1.0f, 1.0f, 1.0f, 4.0f, 1.0f, 8.0f, 5.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, + 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, + 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, + 1.0f, 1.0f, 1.0f, 1.0f, 1.0f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f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, + 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f + }), // 1 x 3 = 3 - ov::test::utils::create_tensor(netPrecision, Shape{1, 3}, getValues({16.0f, 12.0f, 1.0f}))}; - - return inputTensors; -} -} // namespace - -void ExperimentalDetectronDetectionOutputLayerTest::generate_inputs( - const std::vector& targetInputStaticShapes) { - const auto netPrecision = std::get<9>(GetParam()); - - const std::vector inputTensors = - (netPrecision == element::f16) ? generateInputTensors() : generateInputTensors(); + ov::test::utils::create_tensor(ov::element::f32, Shape{1, 3}, {1.0f, 1.0f, 1.0f}) + }; inputs.clear(); const auto& funcInputs = function->inputs(); @@ -168,6 +142,6 @@ void ExperimentalDetectronDetectionOutputLayerTest::generate_inputs( } } -} // namespace subgraph -} // namespace test -} // namespace ov +} // namespace subgraph +} // namespace test +} // namespace ov