[CVS-98877][MX] - NonMaxSuppression opset5 -> opset9 (#14683)
This commit is contained in:
parent
61c9deb284
commit
349d1f6647
|
|
@ -7,6 +7,7 @@
|
|||
#include <ngraph/node.hpp>
|
||||
#include <legacy/ngraph_ops/nms_ie.hpp>
|
||||
#include <ngraph/opsets/opset5.hpp>
|
||||
#include <ngraph/opsets/opset9.hpp>
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
|
@ -17,7 +18,7 @@ class StaticShapeNonMaxSuppression : public ngraph::op::NonMaxSuppressionIE3 {
|
|||
public:
|
||||
OPENVINO_OP("StaticShapeNonMaxSuppression", "VPUOpset", ngraph::op::NonMaxSuppressionIE3);
|
||||
|
||||
explicit StaticShapeNonMaxSuppression(const ngraph::opset5::NonMaxSuppression& nms);
|
||||
explicit StaticShapeNonMaxSuppression(const ngraph::opset9::NonMaxSuppression& nms);
|
||||
|
||||
StaticShapeNonMaxSuppression(const Output<Node>& boxes,
|
||||
const Output<Node>& scores,
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
namespace ngraph { namespace vpu { namespace op {
|
||||
|
||||
StaticShapeNonMaxSuppression::StaticShapeNonMaxSuppression(const ngraph::opset5::NonMaxSuppression& nms)
|
||||
StaticShapeNonMaxSuppression::StaticShapeNonMaxSuppression(const ngraph::opset9::NonMaxSuppression& nms)
|
||||
: StaticShapeNonMaxSuppression(
|
||||
nms.input_value(0),
|
||||
nms.input_value(1),
|
||||
|
|
@ -18,7 +18,7 @@ StaticShapeNonMaxSuppression::StaticShapeNonMaxSuppression(const ngraph::opset5:
|
|||
nms.get_input_size() > 3 ? nms.input_value(3) : ngraph::opset5::Constant::create(ngraph::element::f32, ngraph::Shape{}, {.0f}),
|
||||
nms.get_input_size() > 4 ? nms.input_value(4) : ngraph::opset5::Constant::create(ngraph::element::f32, ngraph::Shape{}, {.0f}),
|
||||
nms.get_input_size() > 5 ? nms.input_value(5) : ngraph::opset5::Constant::create(ngraph::element::f32, ngraph::Shape{}, {.0f}),
|
||||
nms.get_box_encoding() == ngraph::opset5::NonMaxSuppression::BoxEncodingType::CENTER ? 1 : 0,
|
||||
nms.get_box_encoding() == ngraph::opset9::NonMaxSuppression::BoxEncodingType::CENTER ? 1 : 0,
|
||||
nms.get_sort_result_descending(),
|
||||
nms.get_output_type()) {}
|
||||
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@
|
|||
#include "ngraph/opsets/opset5.hpp"
|
||||
#include "ngraph/opsets/opset6.hpp"
|
||||
#include "ngraph/opsets/opset8.hpp"
|
||||
#include "ngraph/opsets/opset9.hpp"
|
||||
|
||||
namespace vpu {
|
||||
|
||||
|
|
@ -110,7 +111,7 @@ const Transformations& getDefaultTransformations() {
|
|||
{ngraph::opset3::Minimum::get_type_info_static(), dynamicToStaticShapeBinaryEltwise},
|
||||
{ngraph::opset3::Less::get_type_info_static(), dynamicToStaticShapeBinaryEltwise},
|
||||
{ngraph::opset5::Select::get_type_info_static(), dynamicToStaticShapeBinaryEltwise},
|
||||
{ngraph::opset5::NonMaxSuppression::get_type_info_static(), dynamicToStaticNonMaxSuppression},
|
||||
{ngraph::opset9::NonMaxSuppression::get_type_info_static(), dynamicToStaticNonMaxSuppression},
|
||||
{ngraph::opset3::NonZero::get_type_info_static(), dynamicToStaticShapeNonZero},
|
||||
{ngraph::opset3::TopK::get_type_info_static(), dynamicToStaticShapeTopK},
|
||||
{ngraph::opset3::Transpose::get_type_info_static(), dynamicToStaticShapeTranspose},
|
||||
|
|
|
|||
|
|
@ -11,15 +11,16 @@
|
|||
#include <vpu/utils/error.hpp>
|
||||
#include "ngraph/graph_util.hpp"
|
||||
#include "ngraph/opsets/opset5.hpp"
|
||||
#include "ngraph/opsets/opset9.hpp"
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace vpu {
|
||||
|
||||
void dynamicToStaticNonMaxSuppression(std::shared_ptr<ngraph::Node> node) {
|
||||
auto nms = std::dynamic_pointer_cast<ngraph::opset5::NonMaxSuppression>(node);
|
||||
auto nms = std::dynamic_pointer_cast<ngraph::opset9::NonMaxSuppression>(node);
|
||||
VPU_THROW_UNLESS(nms, "dynamicToStaticNonMaxSuppression transformation for {} of type {} expects {} as node for replacement",
|
||||
node->get_friendly_name(), node->get_type_info(), ngraph::opset5::NonMaxSuppression::get_type_info_static());
|
||||
node->get_friendly_name(), node->get_type_info(), ngraph::opset9::NonMaxSuppression::get_type_info_static());
|
||||
|
||||
auto staticShapeNMS = std::make_shared<ngraph::vpu::op::StaticShapeNonMaxSuppression>(*nms);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue