mirror of
https://github.com/opencv/opencv.git
synced 2026-07-31 08:13:04 +04:00
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
This commit is contained in:
@@ -129,7 +129,13 @@ endif()
|
||||
|
||||
set(dnn_runtime_libs "")
|
||||
if(INF_ENGINE_TARGET)
|
||||
ocv_option(OPENCV_DNN_IE_NN_BUILDER_2019 "Build with Inference Engine NN Builder API support" ON) # future: NOT HAVE_NGRAPH
|
||||
set(use_nn_builder OFF)
|
||||
if(TARGET inference_engine_nn_builder OR # custom imported target
|
||||
TARGET IE::inference_engine_nn_builder OR # default imported target via InferenceEngineConfig.cmake
|
||||
INF_ENGINE_RELEASE VERSION_LESS "2020000000") # compatibility with older versions on IE
|
||||
set(use_nn_builder ON)
|
||||
endif()
|
||||
ocv_option(OPENCV_DNN_IE_NN_BUILDER_2019 "Build with Inference Engine NN Builder API support" ${use_nn_builder}) # future: NOT HAVE_NGRAPH
|
||||
if(OPENCV_DNN_IE_NN_BUILDER_2019)
|
||||
message(STATUS "DNN: Enabling Inference Engine NN Builder API support")
|
||||
add_definitions(-DHAVE_DNN_IE_NN_BUILDER_2019=1)
|
||||
|
||||
@@ -77,7 +77,11 @@ public:
|
||||
return type_info;
|
||||
}
|
||||
|
||||
#if INF_ENGINE_VER_MAJOR_GT(2020020000)
|
||||
NgraphCustomOp(const ngraph::OutputVector& inputs,
|
||||
#else
|
||||
NgraphCustomOp(const ngraph::NodeVector& inputs,
|
||||
#endif
|
||||
const std::map<std::string, InferenceEngine::Parameter>& params = {}):
|
||||
Op(inputs), params(params)
|
||||
{
|
||||
@@ -103,7 +107,11 @@ public:
|
||||
|
||||
std::shared_ptr<ngraph::Node> copy_with_new_args(const ngraph::NodeVector& new_args) const override
|
||||
{
|
||||
#if INF_ENGINE_VER_MAJOR_GT(2020020000)
|
||||
return std::make_shared<NgraphCustomOp>(ngraph::as_output_vector(new_args), params);
|
||||
#else
|
||||
return std::make_shared<NgraphCustomOp>(new_args, params);
|
||||
#endif
|
||||
}
|
||||
|
||||
bool visit_attributes(ngraph::AttributeVisitor& visitor) override
|
||||
@@ -270,7 +278,11 @@ InfEngineNgraphNode::InfEngineNgraphNode(const std::vector<Ptr<BackendNode> >& n
|
||||
{"internals", shapesToStr(internals)}
|
||||
};
|
||||
|
||||
#if INF_ENGINE_VER_MAJOR_GT(2020020000)
|
||||
ngraph::OutputVector inp_nodes;
|
||||
#else
|
||||
ngraph::NodeVector inp_nodes;
|
||||
#endif
|
||||
for (const auto& node : nodes)
|
||||
inp_nodes.emplace_back(node.dynamicCast<InfEngineNgraphNode>()->node);
|
||||
node = std::make_shared<NgraphCustomOp>(inp_nodes, params);
|
||||
|
||||
@@ -147,7 +147,7 @@ public:
|
||||
const std::vector<Ptr<BackendNode> >& nodes) CV_OVERRIDE
|
||||
{
|
||||
auto& ieInpNode = nodes[0].dynamicCast<InfEngineNgraphNode>()->node;
|
||||
ngraph::NodeVector inp{ieInpNode};
|
||||
ngraph::OutputVector inp{ieInpNode};
|
||||
auto blank = std::make_shared<ngraph::op::Concat>(inp, 0);
|
||||
return Ptr<BackendNode>(new InfEngineNgraphNode(blank));
|
||||
}
|
||||
|
||||
@@ -358,7 +358,7 @@ public:
|
||||
std::vector<size_t> maxDims(numDims, 0);
|
||||
|
||||
CV_Assert(inputs.size() == nodes.size());
|
||||
ngraph::NodeVector inp_nodes;
|
||||
ngraph::OutputVector inp_nodes;
|
||||
for (int i = 0; i < nodes.size(); ++i)
|
||||
{
|
||||
inp_nodes.push_back(nodes[i].dynamicCast<InfEngineNgraphNode>()->node);
|
||||
|
||||
@@ -473,7 +473,7 @@ public:
|
||||
ieLayer.setRoundingType(ceilMode ?
|
||||
InferenceEngine::Builder::PoolingLayer::RoundingType::CEIL :
|
||||
InferenceEngine::Builder::PoolingLayer::RoundingType::FLOOR);
|
||||
ieLayer.setExcludePad(type == AVE && padMode == "SAME");
|
||||
ieLayer.setExcludePad(!avePoolPaddedArea);
|
||||
|
||||
InferenceEngine::Builder::Layer l = ieLayer;
|
||||
if (!padMode.empty())
|
||||
|
||||
@@ -24,10 +24,11 @@
|
||||
#define INF_ENGINE_RELEASE_2019R2 2019020000
|
||||
#define INF_ENGINE_RELEASE_2019R3 2019030000
|
||||
#define INF_ENGINE_RELEASE_2020_1 2020010000
|
||||
#define INF_ENGINE_RELEASE_2020_2 2020020000
|
||||
|
||||
#ifndef INF_ENGINE_RELEASE
|
||||
#warning("IE version have not been provided via command-line. Using 2019.1 by default")
|
||||
#define INF_ENGINE_RELEASE INF_ENGINE_RELEASE_2020_1
|
||||
#warning("IE version have not been provided via command-line. Using 2020.2 by default")
|
||||
#define INF_ENGINE_RELEASE INF_ENGINE_RELEASE_2020_2
|
||||
#endif
|
||||
|
||||
#define INF_ENGINE_VER_MAJOR_GT(ver) (((INF_ENGINE_RELEASE) / 10000) > ((ver) / 10000))
|
||||
@@ -58,7 +59,9 @@
|
||||
|
||||
#include <inference_engine.hpp>
|
||||
|
||||
#ifdef HAVE_DNN_IE_NN_BUILDER_2019
|
||||
#include <ie_builders.hpp>
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && INF_ENGINE_VER_MAJOR_LT(INF_ENGINE_RELEASE_2020_1)
|
||||
#pragma GCC visibility pop
|
||||
|
||||
Reference in New Issue
Block a user