[Opset13][ONNX] NMSRotated-13 test and sort update (#20670)

* Set sort_result_descending attr false for nms

* Add onnx test

* Tmp exclude for CPU

* Update test values

* Update test vals to avoid cast warning

* Fix typo
This commit is contained in:
Katarzyna Mitrus authored and GitHub committed 2023-10-30 17:14:37 +01:00
1 parent a4c47bf6ab
commit fdec7fb7ee
4 files changed
+90 -1

No files matched your search

@@ -30,7 +30,8 @@ inline OutputVector nms_rotated(const Node& node) {
node.get_ng_inputs().at(1),
max_output_boxes_per_class,
iou_threshold_const,
score_threshold_const);
score_threshold_const,
false);
return {nms->output(0)};
}
@@ -0,0 +1,71 @@
ir_version: 8
producer_name: "onnx_frontend_test"
graph {
node {
input: "boxes"
input: "scores"
output: "selected_indices"
op_type: "NMSRotated"
domain: "mmdeploy"
attribute {
name: "iou_threshold"
f: 0.5
type: FLOAT
}
attribute {
name: "score_threshold"
f: 0.3
type: FLOAT
}
}
input {
name: "boxes"
type {
tensor_type {
elem_type: 1
shape {
dim {
dim_value: 1
}
dim {
dim_value: 4
}
dim {
dim_value: 5
}
}
}
}
}
input {
name: "scores"
type {
tensor_type {
elem_type: 1
shape {
dim {
dim_value: 1
}
dim {
dim_value: 1
}
dim {
dim_value: 4
}
}
}
}
}
output {
name: "selected_indices"
type {
tensor_type {
elem_type: 7
}
}
}
}
opset_import {
domain: "mmdeploy"
version: 1
}
@@ -6962,3 +6962,17 @@ OPENVINO_TEST(${BACKEND_NAME}, onnx_group_normalization_2grp_custom_eps) {
test_case.run_with_tolerance_as_fp(0.000001f);
}
OPENVINO_TEST(${BACKEND_NAME}, onnx_model_mm_nms_rotated) {
auto function = onnx_import::import_onnx_model(
file_util::path_join(ov::test::utils::getExecutableDirectory(), SERIALIZED_ZOO, "onnx/mm_nms_rotated.onnx"));
auto test_case = ov::test::TestCase(function, s_device);
test_case.add_input(Shape{1, 4, 5},
std::vector<float>({23.0f, 10.5f, 4.0f, 15.0f, 2.5f, 11.0f, 15.0f, 4.0f, 2.0f, 0.7854f,
20.0f, 4.5f, 4.0f, 3.0f, -5.3f, 8.0f, 11.5f, 4.0f, 3.0f, -0.5236f}));
test_case.add_input(Shape{1, 1, 4}, std::vector<float>({0.6f, 0.8f, 0.5f, 0.7f}));
test_case.add_expected_output<int64_t>(Shape{4, 3}, {0, 0, 1, 0, 0, 3, 0, 0, 0, 0, 0, 2});
test_case.run();
}
@@ -205,6 +205,9 @@ IE_CPU.onnx_constant_sparse_tensor_double_3x4
IE_CPU.onnx_constant_sparse_tensor_int16_3x4
IE_CPU.onnx_constant_sparse_tensor_uint16_3x4
# Unsupported op NMSRotated
onnx_model_mm_nms_rotated
#-------------------------------------------------------------------------------
#
# Inference Engine GPU plugin excludes