diff --git a/docs/template_plugin/backend/evaluates_map.cpp b/docs/template_plugin/backend/evaluates_map.cpp index c0bec3b8c8a0c0..0322d8fe7931a7 100644 --- a/docs/template_plugin/backend/evaluates_map.cpp +++ b/docs/template_plugin/backend/evaluates_map.cpp @@ -2052,11 +2052,11 @@ bool evaluate(const shared_ptr& op const HostTensorVector& outputs, const HostTensorVector& inputs) { const auto attrs = op->get_attrs(); - size_t rois_num = attrs.max_detections_per_image; + const size_t output_roi_count = attrs.max_detections_per_image; - 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 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 auto output_type = op->get_input_element_type(0); @@ -2064,6 +2064,7 @@ 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)); @@ -2080,6 +2081,7 @@ 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 0f5841fc32172e..0a64e59f25942d 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,9 +2,10 @@ // 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; @@ -18,9 +19,13 @@ 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), @@ -33,11 +38,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; @@ -56,7 +61,8 @@ 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(); @@ -84,12 +90,9 @@ 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}); } }; @@ -101,68 +104,54 @@ 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, 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, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f}, - std::vector{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, 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, 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{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}), + 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, 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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, 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}), }; return experimentalDOParams; } std::vector generateExperimentalDOCombinedParams() { - const std::vector> ExperimentalDOTypeParams { + const std::vector> ExperimentalDOTypeParams{ generateExperimentalDOFloatParams(), generateExperimentalDOFloatParams(), generateExperimentalDOFloatParams(), - }; + }; std::vector combinedParams; for (const auto& params : ExperimentalDOTypeParams) { @@ -171,6 +160,8 @@ 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 b2147fe9c461e8..0e57eace94f461 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,6 +34,7 @@ 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 2ffafacf79b48a..53e08ddb1b5291 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 = 1; class_idx < classes_num; ++class_idx) { + for (int class_idx = 0; 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::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); + 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); // recompute new width & height const float box_w = x1_new - x0_new + coordinates_offset; @@ -214,6 +214,7 @@ 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, @@ -221,7 +222,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(attrs.max_detections_per_image); + const int64_t rois_num = static_cast(roi_count); 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; @@ -255,7 +256,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 = 1; class_idx < classes_num; ++class_idx) { + for (int64_t class_idx = 0; 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 cce55ce82800ae..d2ffe49c3ef987 100644 --- a/src/frontends/tests/onnx/onnx_import_org_openvino.in.cpp +++ b/src/frontends/tests/onnx/onnx_import_org_openvino.in.cpp @@ -272,54 +272,34 @@ 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, 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, 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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}); // scores - 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}); + 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}); // im_info - test_case.add_input({1.0f, 1.0f, 1.0f}); + test_case.add_input({16.0f, 12.0f, 1.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.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.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 8ee65a165cdcc8..bdf51692cd7684 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,12 +2,13 @@ // 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; @@ -38,13 +39,19 @@ 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}); @@ -69,7 +76,7 @@ void refine_boxes(const float* boxes, const float* deltas, const float* weights, const float ctr_x = x0 + 0.5f * ww; const float ctr_y = y0 + 0.5f * hh; - for (int class_idx = 1; class_idx < classes_num; ++class_idx) { + for (int class_idx = 0; 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]; @@ -90,10 +97,10 @@ void refine_boxes(const float* boxes, const float* deltas, const float* weights, 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::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); + 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); // recompute new width & height const float box_w = x1_new - x0_new + coordinates_offset; @@ -112,26 +119,26 @@ void refine_boxes(const float* boxes, const float* deltas, const float* weights, } template -static bool SortScorePairDescend(const std::pair& pair1, - const std::pair& pair2) { +static bool SortScorePairDescend(const std::pair& pair1, const std::pair& pair2) { return pair1.first > pair2.first; } - 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) { @@ -154,7 +161,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) { @@ -168,7 +175,6 @@ 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, @@ -190,8 +196,10 @@ 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; @@ -224,11 +232,13 @@ 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 (...) { @@ -237,9 +247,10 @@ 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; @@ -266,11 +277,10 @@ 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) { @@ -278,14 +288,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]; @@ -297,10 +307,17 @@ 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); @@ -310,7 +327,7 @@ void ExperimentalDetectronDetectionOutput::execute(dnnl::stream strm) { std::vector detections_per_class(classes_num_, 0); int total_detections_num = 0; - for (int class_idx = 1; class_idx < classes_num_; ++class_idx) { + for (int class_idx = 0; 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})], @@ -356,7 +373,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; @@ -374,6 +391,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/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 3dec96c04b6df4..f4314827338758 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,16 +3,19 @@ // #include "shared_test_classes/single_layer/experimental_detectron_detection_output.hpp" -#include "ngraph_functions/builders.hpp" -#include "common_test_utils/data_utils.hpp" + #include +#include "common_test_utils/data_utils.hpp" +#include "ngraph_functions/builders.hpp" + 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 << "_"; @@ -23,26 +26,25 @@ namespace { 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; @@ -65,18 +67,17 @@ 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(); inType = outType = netPrecision; targetDevice = targetName; @@ -84,49 +85,50 @@ 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); + 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"); } -void ExperimentalDetectronDetectionOutputLayerTest::generate_inputs(const std::vector& targetInputStaticShapes) { +void ExperimentalDetectronDetectionOutputLayerTest::generate_inputs( + const std::vector& targetInputStaticShapes) { static const std::vector inputTensors = { // 16 x 4 = 64 - 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.0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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}), // 16 x 2 = 32 - ov::test::utils::create_tensor(ov::element::f32, Shape{16, 2}, { - 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, 2}, + {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}), // 1 x 3 = 3 - ov::test::utils::create_tensor(ov::element::f32, Shape{1, 3}, {1.0f, 1.0f, 1.0f}) - }; + ov::test::utils::create_tensor(ov::element::f32, Shape{1, 3}, {16.0f, 12.0f, 1.0f})}; inputs.clear(); const auto& funcInputs = function->inputs(); @@ -139,6 +141,6 @@ void ExperimentalDetectronDetectionOutputLayerTest::generate_inputs(const std::v } } -} // namespace subgraph -} // namespace test -} // namespace ov +} // namespace subgraph +} // namespace test +} // namespace ov