Skip To Main Content
Support Knowledge Base

Is It Possible to Run OpenCV Functions with Intel® Neural Compute Stick 2 (NCS2)?

Content Type: Product Information & Documentation   |   Article ID: 000093400   |   Last Reviewed: 06/22/2023

Description

Unable to determine how to run OpenCV functions with NCS2.

Resolution

NCS2 cannot be used to run OpenCV's regular functions. It can only infer Deep Learning network (Intermediate Representation) via the Inference Engine backend of the DNN module.

 

#Load model
net = cv2.dnn.readNetFromModelOptimizer(model.xml, model.bin)

 

#Specify the target device as Myriad for NCS2
net.setPreferableTarget(cv2.dnn.DNN_TARGET_MYRIAD)

 

#Specify the target backend for Inference Engine
net.setPreferableBackend(cv2.dnn.DNN_BACKEND_INFERENCE_ENGINE)