open_model_zoo icon indicating copy to clipboard operation
open_model_zoo copied to clipboard

Can not use dnn opencv module with openvino inference engine

Open francoamato opened this issue 5 years ago • 9 comments

Hi to all, I've just downloaded and installed the last windows release of OpenVino ( OpenVino version 2021.2.185 ). I would like to use it to develop a vehicles and license plates detector using openvino inference ( I use Qt for GUI development ). In my project I linked about the opencv libraries/dll included in the openvino directory ( OpenCV version 4.5.1). Seems the dnn module is not working. I can not do It does not working, I cannot execute any function that belong to that module.

This simple piece of code blocks my code:

const std::string openvino_network = "...path_to_/vehicle-license-plate-detection-barrier-0106/FP32/vehicle-license-plate-detection-barrier-0106.xml";
const std::string openvino_model = "...path_to_/vehicle-license-plate-detection-barrier-0106/FP32/vehicle-license-plate-detection-barrier-0106.bin";

auto vehicleNet = cv::dnn::readNetFromModelOptimizer(openvino_network, openvino_model); //<-- this routine freezes my program
vehicleNet.setPreferableBackend(cv::dnn::DNN_BACKEND_INFERENCE_ENGINE);
vehicleNet.setPreferableTarget(cv::dnn::DNN_TARGET_CPU);

I would have a help please. Thank you very much. Franco

francoamato avatar Dec 19 '20 23:12 francoamato

@alalek @l-bat could you please take a look?

vladimir-dudnik avatar Dec 21 '20 19:12 vladimir-dudnik

@francoamato I assume you use vehicle-license-plate-detection-barrier-0106 from OpenVINO 2021.2 release. Note, old models IR (pre IR v10) might not work with the latest OpenVINO runtime.

vladimir-dudnik avatar Dec 21 '20 22:12 vladimir-dudnik

@vladimir-dudnik Thank you for the information. Please can you send me a model that works with OpenVINO 2021.2 to detect vehicles and license plates? Thanx

francoamato avatar Dec 22 '20 01:12 francoamato

@francoamato you can download OpenVINO 2021.2 models by yourself using Open Model Zoo model downloader.

vladimir-dudnik avatar Dec 22 '20 08:12 vladimir-dudnik

@vladimir-dudnik I've just downloaded the model age-gender-recognition-retail-0013.[xml,bin] and the problem is still there. It seems like it's not possible to load ANY openvino ir models with the last release of openvino and opencv. It works loading non openvino ir models. Any concrete help please? Thanx

francoamato avatar Dec 22 '20 13:12 francoamato

@francoamato I do not know what kind of issue you have with this, I've just copy-pasted the lines below into OpenCV colorization sample, build and run it up to readNetFromModelOptimizer call. It can successfully read model. Have you noticed that readNetFromModelOptimizer API expect cv::String but you specified std::string?

cv::String topo = "C:\\Temp\\models\\intel\\vehicle-license-plate-detection-barrier-0106\\FP16\\vehicle-license-plate-detection-barrier-0106.xml";
cv::String weights = "C:\\Temp\\models\\intel\\vehicle-license-plate-detection-barrier-0106\\FP16\\vehicle-license-plate-detection-barrier-0106.bin";
auto vlp_net = cv::dnn::readNetFromModelOptimizer(topo, weights);

vladimir-dudnik avatar Dec 22 '20 20:12 vladimir-dudnik

@vladimir-dudnik What version of OpenVINO and OpenCV did you use to do the test you mentioned?

francoamato avatar Dec 22 '20 20:12 francoamato

I've tested on Windows with the latest release - OpenVINO 2021.2.185

vladimir-dudnik avatar Dec 22 '20 22:12 vladimir-dudnik

@francoamato have this answers your question?

vladimir-dudnik avatar May 19 '21 17:05 vladimir-dudnik