Resolving OpenCV issues to run Tiny YOLO on the Movidius Neural Compute Stick

I recently got my hands on the Intel Movidius Neural Compute Stick. It is an amazing piece of hardware that addresses the need for intelligence at the edge.The Movidius Neural Compute Stick(NCS) is a low-cost, form-factor developer kit for low-power vision based embedded inference applications. It enables you to develop low-power intelligent edge devices solutions for image processing using deep learning algorithms.

Picture1I came across a great tutorial on getting started with the Movidius NCS and Tiny YOLO on this blog post https://blog.codecentric.de/2017/10/objekterkennung-mit-neuronalen-netzen-movidius-neural-compute-stick/. 

I would like to share a workaround for a very frustrating problem that’s not covered in the tutorial and that  I came across trying to run the yolo_object_detection_app example which detects objects in a video stream captured by the webcam and marks the objects in the video.

I was not able to get the demo to run because I initially had installed OpenCV from the Debian source and this has no webcam support. Thus when you run the demo you’ll get the error below on the terminal

err

Since this version of OpenCV has no webcam support, it’s not possible to get a video stream for processing. You can verify this by running cv2.imshow()  in the code and see the frame returns ‘None’.

To resolve this issue, first remove all the packages of the OpenCV installed from Debian repo. Do pip3 list | grep opencv and remove all the entries listed.

Once that is done, proceed to install OpenCV from this github source http://milq.github.io/install-opencv-ubuntu-debian/    by running the installation script bash install-opencv.sh and everything should now work fine once the installation is finished! Happy exploration with the Movidius NCS!

 

Leave a Reply

Your email address will not be published. Required fields are marked *