Extend ONNX FE for operation DetectionOutput-8 (#9055)

This commit is contained in:
Artur Kulikowski 2021-12-08 09:34:57 +01:00 committed by GitHub
parent 64c6ca05ed
commit bc08878e91
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,8 +20,7 @@ OutputVector detection_output(const Node& node) {
auto class_preds = inputs[1];
auto proposals = inputs[2];
ngraph::op::DetectionOutputAttrs attrs;
attrs.num_classes = node.get_attribute_value<int64_t>("num_classes");
ov::op::v8::DetectionOutput::Attributes attrs;
attrs.background_label_id = node.get_attribute_value<int64_t>("background_label_id", 0);
attrs.top_k = node.get_attribute_value<int64_t>("top_k", -1);
attrs.variance_encoded_in_target = node.get_attribute_value<int64_t>("variance_encoded_in_target", 0);
@ -51,16 +50,16 @@ OutputVector detection_output(const Node& node) {
attrs.objectness_score = node.get_attribute_value<float>("objectness_score", 0);
if (inputs.size() == 3) {
return {std::make_shared<default_opset::DetectionOutput>(box_logits, class_preds, proposals, attrs)};
return {std::make_shared<ov::op::v8::DetectionOutput>(box_logits, class_preds, proposals, attrs)};
} else if (inputs.size() == 5) {
auto aux_class_preds = inputs[3];
auto aux_box_preds = inputs[4];
return {std::make_shared<default_opset::DetectionOutput>(box_logits,
class_preds,
proposals,
aux_class_preds,
aux_box_preds,
attrs)};
return {std::make_shared<ov::op::v8::DetectionOutput>(box_logits,
class_preds,
proposals,
aux_class_preds,
aux_box_preds,
attrs)};
} else {
NGRAPH_CHECK(false, "Invalid number of inputs");
}