I checked implementation status of layer in dnn module.
So, I tried to use supportBackend
method.
This time, I used OpenCV 4.5.3(enabled Intel Inference Engine).
So, I guess that supportBackend(cv::dnn::DNN_BACKEND_INFERENCE_ENGINE)
returns true
. But, supportBackend(cv::dnn::DNN_BACKEND_INFERENCE_ENGINE)
returns false
. I don’t know why.
Source code
#include <opencv2/dnn.hpp>
#include <iostream>
int main()
{
cv::dnn::LayerParams params;
cv::Ptr<cv::dnn::Layer> layer = cv::dnn::LayerFactory::createLayerInstance("Crop", params);
std::cout << "[Crop Layer]" << std::endl;
std::cout << " DNN_BACKEND_OPENCV: " << layer->supportBackend(cv::dnn::DNN_BACKEND_OPENCV) << std::endl;
std::cout << " DNN_BACKEND_CUDA: " << layer->supportBackend(cv::dnn::DNN_BACKEND_CUDA) << std::endl;
std::cout << " DNN_BACKEND_INFERENCE_ENGINE: " << layer->supportBackend(cv::dnn::DNN_BACKEND_INFERENCE_ENGINE) << std::endl;
return 0;
}
Result
[Crop Layer]
DNN_BACKEND_OPENCV: 1
DNN_BACKEND_CUDA: 1
DNN_BACKEND_INFERENCE_ENGINE: 0