Can not use dnn opencv module with openvino inference engine
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
@alalek @l-bat could you please take a look?
@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 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 you can download OpenVINO 2021.2 models by yourself using Open Model Zoo model downloader.
@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 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 What version of OpenVINO and OpenCV did you use to do the test you mentioned?
I've tested on Windows with the latest release - OpenVINO 2021.2.185
@francoamato have this answers your question?