1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 23:33:05 +04:00

Update Intel's Inference Engine deep learning backend (#11587)

* Update Intel's Inference Engine deep learning backend

* Remove cpu_extension dependency

* Update Darknet accuracy tests
This commit is contained in:
Dmitry Kurtaev
2018-05-31 14:05:21 +03:00
committed by Vadim Pisarevsky
parent 80770aacd7
commit f96f934426
20 changed files with 280 additions and 113 deletions
@@ -117,7 +117,7 @@ public:
{
return backendId == DNN_BACKEND_DEFAULT ||
backendId == DNN_BACKEND_HALIDE && haveHalide() ||
backendId == DNN_BACKEND_INFERENCE_ENGINE && haveInfEngine() && this->type != "Sigmoid";
backendId == DNN_BACKEND_INFERENCE_ENGINE && haveInfEngine();
}
virtual Ptr<BackendNode> tryAttach(const Ptr<BackendNode>& node) CV_OVERRIDE
@@ -334,6 +334,7 @@ struct ReLUFunctor
lp.type = "ReLU";
std::shared_ptr<InferenceEngine::ReLULayer> ieLayer(new InferenceEngine::ReLULayer(lp));
ieLayer->negative_slope = slope;
ieLayer->params["negative_slope"] = format("%f", slope);
return ieLayer;
}
#endif // HAVE_INF_ENGINE
@@ -431,6 +432,8 @@ struct ReLU6Functor
std::shared_ptr<InferenceEngine::ClampLayer> ieLayer(new InferenceEngine::ClampLayer(lp));
ieLayer->min_value = minValue;
ieLayer->max_value = maxValue;
ieLayer->params["min"] = format("%f", minValue);
ieLayer->params["max"] = format("%f", maxValue);
return ieLayer;
}
#endif // HAVE_INF_ENGINE
@@ -556,8 +559,9 @@ struct SigmoidFunctor
#ifdef HAVE_INF_ENGINE
InferenceEngine::CNNLayerPtr initInfEngine(InferenceEngine::LayerParams& lp)
{
CV_Error(Error::StsNotImplemented, "Sigmoid");
return InferenceEngine::CNNLayerPtr();
lp.type = "Sigmoid";
std::shared_ptr<InferenceEngine::CNNLayer> ieLayer(new InferenceEngine::CNNLayer(lp));
return ieLayer;
}
#endif // HAVE_INF_ENGINE