I am trying to use the EAST-text-detector in OpenCV in Python with preferable backend DNN_BACKEND_INFERENCE_ENGINE and preferable target DNN_TARGET_MYRIAD.
net = cv2.dnn.readNet('frozen_east_text_detection.pb') net.setPreferableBackend(cv2.dnn.DNN_BACKEND_INFERENCE_ENGINE) net.setPreferableTarget(cv2.dnn.DNN_TARGET_MYRIAD) layerNames = [ "feature_fusion/Conv_7/Sigmoid", "feature_fusion/concat_3" ]
When doing a forward pass:
blob = cv2.dnn.blobFromImage(image, 1.0, (newW, newH), (123.68, 116.78, 103.94), swapRB=True, crop=False) net.setInput(blob) (scores, geometry) = net.forward(layerNames)
It gives the following error:
cv2.error: OpenCV(4.1.0) /io/opencv/modules/dnn/src/dnn.cpp:1009: error: (-215:Assertion failed) haveInfEngine() in function 'wrapMat'
OpenVino is installed. What might be the problem?
I assume you've built OpenCV by yourself and you are not using the one installed with OpenVINO. What is your cmake output? Does it contain "Inference Engine: YES" line? Run the following command and verify:
If it does not say "YES", make sure you are using compatible version of Inference Engine, 4.1.0 is rather old version. Also don't forget to set cmake option "INF_ENGINE_RELEASE" to the correct version, e.g. "2019010000" for OpenVINO 2019 R1.0.0.