mirror of
https://github.com/opencv/opencv.git
synced 2025-06-17 15:20:51 +08:00
Enable OpenVINO max pooling with indices since 2022.1
This commit is contained in:
parent
ca0bd70cde
commit
a0debc3a9a
@ -209,7 +209,8 @@ public:
|
|||||||
#ifdef HAVE_INF_ENGINE
|
#ifdef HAVE_INF_ENGINE
|
||||||
if (backendId == DNN_BACKEND_INFERENCE_ENGINE_NGRAPH)
|
if (backendId == DNN_BACKEND_INFERENCE_ENGINE_NGRAPH)
|
||||||
{
|
{
|
||||||
return type != STOCHASTIC && kernel_size.size() > 1 && (kernel_size.size() != 3 || !isArmComputePlugin());
|
return type != STOCHASTIC && kernel_size.size() > 1 && (kernel_size.size() != 3 || !isArmComputePlugin()) &&
|
||||||
|
(!computeMaxIdx || INF_ENGINE_VER_MAJOR_GE(INF_ENGINE_RELEASE_2022_1));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (backendId == DNN_BACKEND_OPENCV)
|
if (backendId == DNN_BACKEND_OPENCV)
|
||||||
@ -615,10 +616,14 @@ public:
|
|||||||
else if (type == MAX) {
|
else if (type == MAX) {
|
||||||
std::shared_ptr<ngraph::Node> max_pool;
|
std::shared_ptr<ngraph::Node> max_pool;
|
||||||
if (computeMaxIdx) {
|
if (computeMaxIdx) {
|
||||||
|
#if INF_ENGINE_VER_MAJOR_GE(INF_ENGINE_RELEASE_2022_1)
|
||||||
std::vector<size_t> dilations(kernel_size.size(), 1);
|
std::vector<size_t> dilations(kernel_size.size(), 1);
|
||||||
max_pool = std::make_shared<ngraph::op::v8::MaxPool>(ieInpNode, ngraph::Strides(strides), ngraph::Strides(dilations),
|
max_pool = std::make_shared<ngraph::op::v8::MaxPool>(ieInpNode, ngraph::Strides(strides), ngraph::Strides(dilations),
|
||||||
ngraph::Shape(pads_begin), ngraph::Shape(pads_end), ngraph::Shape(kernel_size),
|
ngraph::Shape(pads_begin), ngraph::Shape(pads_end), ngraph::Shape(kernel_size),
|
||||||
rounding_type, pad_type);
|
rounding_type, pad_type);
|
||||||
|
#else
|
||||||
|
CV_Error(Error::StsNotImplemented, "OpenVINO MaxPool with indices");
|
||||||
|
#endif
|
||||||
} else {
|
} else {
|
||||||
max_pool = std::make_shared<ngraph::op::v1::MaxPool>(ieInpNode, ngraph::Strides(strides),
|
max_pool = std::make_shared<ngraph::op::v1::MaxPool>(ieInpNode, ngraph::Strides(strides),
|
||||||
ngraph::Shape(pads_begin), ngraph::Shape(pads_end), ngraph::Shape(kernel_size),
|
ngraph::Shape(pads_begin), ngraph::Shape(pads_end), ngraph::Shape(kernel_size),
|
||||||
|
@ -128,6 +128,11 @@ TEST_P(Test_TFLite, max_unpooling)
|
|||||||
if (backend == DNN_BACKEND_CUDA)
|
if (backend == DNN_BACKEND_CUDA)
|
||||||
applyTestTag(CV_TEST_TAG_DNN_SKIP_CUDA);
|
applyTestTag(CV_TEST_TAG_DNN_SKIP_CUDA);
|
||||||
|
|
||||||
|
#if defined(INF_ENGINE_RELEASE) && INF_ENGINE_VER_MAJOR_LT(2022010000)
|
||||||
|
if (backend == DNN_BACKEND_INFERENCE_ENGINE_NGRAPH)
|
||||||
|
applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_NGRAPH, CV_TEST_TAG_DNN_SKIP_IE_VERSION);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (backend == DNN_BACKEND_INFERENCE_ENGINE_NGRAPH && target != DNN_TARGET_CPU) {
|
if (backend == DNN_BACKEND_INFERENCE_ENGINE_NGRAPH && target != DNN_TARGET_CPU) {
|
||||||
if (target == DNN_TARGET_OPENCL_FP16) applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_OPENCL_FP16, CV_TEST_TAG_DNN_SKIP_IE_NGRAPH);
|
if (target == DNN_TARGET_OPENCL_FP16) applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_OPENCL_FP16, CV_TEST_TAG_DNN_SKIP_IE_NGRAPH);
|
||||||
if (target == DNN_TARGET_OPENCL) applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_OPENCL, CV_TEST_TAG_DNN_SKIP_IE_NGRAPH);
|
if (target == DNN_TARGET_OPENCL) applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_OPENCL, CV_TEST_TAG_DNN_SKIP_IE_NGRAPH);
|
||||||
|
Loading…
Reference in New Issue
Block a user