Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.
6404 Discussions

Python sample code can not be finished on Windows OS.

Ishida__Ken
Beginner
437 Views

Python sample code can not be finished on Windows OS. But it can be finished on Ubuntu.

Python sample code as follows:

cap = cv2.VideoCapture(0)

cap.set(cv2.CAP_PROP_FPS, 30)

cap.set(cv2.CAP_PROP_FRAME_WIDTH, camera_width)

cap.set(cv2.CAP_PROP_FRAME_HEIGHT, camera_height)

net = cv2.dnn.readNet('lrmodel/MobileNetSSD/MobileNetSSD_deploy.xml','lrmodel/MobileNetSSD/MobileNetSSD_deploy.bin')

net.setPreferableTarget(cv2.dnn.DNN_TARGET_MYRIAD)

try:

    while True:

:

         blob = cv2.dnn.blobFromImage(color_image, 0.007843, size=(300, 300),  mean=(127.5,127.5,127.5), swapRB=False, crop=False)

:

        cv2.namedWindow('USB Camera', cv2.WINDOW_AUTOSIZE)

        cv2.imshow('USB Camera', cv2.resize(color_image, (width, height)))

        key = cv2.waitKey(1)

        if key & 0xFF == ord('q'):

                    break

cap.release()

cv2.destroyAllWindows()

 

 

0 Kudos
1 Reply
Shubha_R_Intel
Employee
437 Views

Dear Ishida, Ken

 Please start by running the OpenVino python samples on Windows 10. They are located under inference_engine\samples\python_samples. They definitely work on both Linux and Windows. Please make sure your run setupvars.bat first, and from that cmd shell, run your python script.

So if your code doesn't work on Windows, there's a coding bug somewhere (which I cannot detect by inspecting your pasted code).

Thanks,

Shubha

0 Kudos
Reply