* Revert "Fix experimental detectron do ref impl (#10621)"
This reverts commit d87233863d.
* Disabled Experimental Detectron per agreement with GPU team. Ticket to fix it: 90209
This commit is contained in:
committed by
GitHub
parent
f633286a75
commit
4daee82b8d
@@ -2114,11 +2114,11 @@ bool evaluate(const shared_ptr<op::v6::ExperimentalDetectronDetectionOutput>& 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);
|
||||
|
||||
@@ -2126,7 +2126,6 @@ bool evaluate(const shared_ptr<op::v6::ExperimentalDetectronDetectionOutput>& 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<float> output_boxes(shape_size(output_boxes_shape));
|
||||
std::vector<int32_t> output_classes(shape_size(output_classes_shape));
|
||||
@@ -2143,7 +2142,6 @@ bool evaluate(const shared_ptr<op::v6::ExperimentalDetectronDetectionOutput>& op
|
||||
input_deltas_data.data(),
|
||||
input_scores_data.data(),
|
||||
input_im_info_data.data(),
|
||||
input_roi_count,
|
||||
attrs,
|
||||
output_boxes.data(),
|
||||
output_scores.data(),
|
||||
|
||||
@@ -2,10 +2,9 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
#include "openvino/op/experimental_detectron_detection_output.hpp"
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#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<IT>& roisValues,
|
||||
const std::vector<IT>& deltasValues,
|
||||
const std::vector<IT>& scoresValues,
|
||||
const std::vector<IT>& imageSizeInfoValues,
|
||||
const std::vector<IT>& refBoxesValues,
|
||||
const std::vector<int32_t>& refClassesValues,
|
||||
const std::vector<IT>& refScoresValues,
|
||||
const std::vector<IT>& roisValues, const std::vector<IT>& deltasValues,
|
||||
const std::vector<IT>& scoresValues, const std::vector<IT>& imageSizeInfoValues,
|
||||
const std::vector<IT>& refBoxesValues, const std::vector<int32_t>& refClassesValues, const std::vector<IT>& 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<size_t>(attrs.num_classes * 4)};
|
||||
scoresShape = Shape{num_rois, static_cast<size_t>(attrs.num_classes)};
|
||||
imageSizeInfoShape = Shape{1, 3};
|
||||
}
|
||||
roisShape = Shape{num_rois, 4};
|
||||
deltasShape = Shape{num_rois, static_cast<size_t>(attrs.num_classes * 4)};
|
||||
scoresShape = Shape{num_rois, static_cast<size_t>(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<ExperimentalDOParams>,
|
||||
public CommonReferenceTest {
|
||||
class ReferenceExperimentalDOLayerTest : public testing::TestWithParam<ExperimentalDOParams>, public CommonReferenceTest {
|
||||
public:
|
||||
void SetUp() override {
|
||||
auto params = GetParam();
|
||||
@@ -90,9 +84,12 @@ private:
|
||||
const auto deltas = std::make_shared<op::v0::Parameter>(params.inType, params.deltasShape);
|
||||
const auto scores = std::make_shared<op::v0::Parameter>(params.inType, params.scoresShape);
|
||||
const auto im_info = std::make_shared<op::v0::Parameter>(params.inType, params.imageSizeInfoShape);
|
||||
const auto ExperimentalDO =
|
||||
std::make_shared<op::v6::ExperimentalDetectronDetectionOutput>(rois, deltas, scores, im_info, params.attrs);
|
||||
return std::make_shared<ov::Model>(ExperimentalDO->outputs(), ParameterVector{rois, deltas, scores, im_info});
|
||||
const auto ExperimentalDO = std::make_shared<op::v6::ExperimentalDetectronDetectionOutput>(rois,
|
||||
deltas,
|
||||
scores,
|
||||
im_info,
|
||||
params.attrs);
|
||||
return std::make_shared<ov::Model>(ExperimentalDO->outputs(), ParameterVector {rois, deltas, scores, im_info});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -104,54 +101,68 @@ template <element::Type_t IN_ET>
|
||||
std::vector<ExperimentalDOParams> generateExperimentalDOFloatParams() {
|
||||
using T = typename element_type_traits<IN_ET>::value_type;
|
||||
|
||||
std::vector<ExperimentalDOParams> 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,
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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, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f},
|
||||
std::vector<ExperimentalDOParams> 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<T>{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<T>{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,
|
||||
|
||||
std::vector<T>{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<T>{16.0f, 12.0f, 1.0f},
|
||||
std::vector<T>{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<int32_t>{0, 1, 0, 0, 0},
|
||||
std::vector<T>{0.8f, 0.9f, 0.0f, 0.0f, 0.0f}),
|
||||
1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f,
|
||||
1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f,
|
||||
1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f,
|
||||
1.0f, 1.0f, 1.0f, 1.0f, 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<T>{1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f,
|
||||
1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 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<T>{1.0f, 1.0f, 1.0f},
|
||||
std::vector<T>{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<int32_t>{1, 0, 0, 0, 0},
|
||||
std::vector<T>{1.0f, 0.0f, 0.0f, 0.0f, 0.0f}),
|
||||
};
|
||||
return experimentalDOParams;
|
||||
}
|
||||
|
||||
std::vector<ExperimentalDOParams> generateExperimentalDOCombinedParams() {
|
||||
const std::vector<std::vector<ExperimentalDOParams>> ExperimentalDOTypeParams{
|
||||
const std::vector<std::vector<ExperimentalDOParams>> ExperimentalDOTypeParams {
|
||||
generateExperimentalDOFloatParams<element::Type_t::f32>(),
|
||||
generateExperimentalDOFloatParams<element::Type_t::f16>(),
|
||||
generateExperimentalDOFloatParams<element::Type_t::bf16>(),
|
||||
};
|
||||
};
|
||||
std::vector<ExperimentalDOParams> combinedParams;
|
||||
|
||||
for (const auto& params : ExperimentalDOTypeParams) {
|
||||
@@ -160,8 +171,6 @@ std::vector<ExperimentalDOParams> 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
|
||||
|
||||
Reference in New Issue
Block a user