Intel® Distribution of OpenVINO™ Toolkit Preview Support for Intel® Neural Compute Stick 2 on Raspbian*

Introduction

As announced in the Release Notes, the Intel® Distribution of OpenVINO™ toolkit 2018 R5 release introduced preview support for Raspbian* 9 as a host for the Intel® Movidius™ Neural Compute Stick and Intel® Neural Compute Stick 2 targets. This paper provides preliminary information and resources for setting up and running Intel® Distribution of OpenVINO™ toolkit on the Raspberry Pi* 3 Model B single board computer with the latest Intel® Neural Compute Stick 2 powered by the Intel® Movidius™ Vision Processing Unit X.

Software and Hardware Components

The following software and hardware components are required to get a Raspberry Pi single board computer up and running with Intel® Distribution of OpenVINO™ toolkit and an Intel® Movidius™ Neural Compute Stick 2 target:

Install Raspbian* Stretch OS

In order to install Intel® Distribution of OpenVINO™ toolkit on your Raspberry Pi 3 Model B board, you must be running the Raspbian 9 (Stretch) operating system. To check the OS version running on your board, open a terminal (Ctrl-Alt-t) and enter the following command:

cat /etc/os-release

The output of this command should look similar to Figure 1.

Figure 1. Raspbian operating system version

For this article, we did a fresh installation of the Raspbian Stretch with desktop and recommended software distribution, which is available here. If you would like to do the same, download the zip file and then follow the directions available here to write the OS image to a microSD* card.

Figure 2. microSD card installation

Once the flashed microSD card is installed in the Raspberry Pi 3 Model B single board computer (see Figure 2), apply power and follow the instructions to choose your locale, connect to a Wi-Fi network with Internet connectivity, update the software and reboot.

Install Intel® Distribution of OpenVINO™ Toolkit and Build Samples

Refer to the guide “Install the Intel® Distribution of OpenVINO™ toolkit for Raspbian* OS” published here. This guide contains all of the required steps required to install and test the Intel® Distribution of OpenVINO™ toolkit on the Raspberry Pi board.

Notes on Building the Code Samples

  1. If you are running a relatively fresh installation of Raspbian Stretch, you may need to install CMake in order to build the code samples. To do this, enter the following command in the terminal:
    sudo apt-get install build-essentials cmake pkg-config
    
  2. If you encounter issues with the system freezing while building all of the code samples using ./build_sample.sh, try temporarily increasing the Raspberry Pi's swap space as described here. For this article, we set the swap size to 2048 (see Figure 3), which resulted in a total build time under two hours. Once all of the code samples have been compiled, you can set the swap space back to its original size. 

     

    Figure 3. Swap space reported with free –m

  3. Be sure to read the comments in Install the Intel® Distribution of OpenVINO™ Toolkit for Raspbian* OS for additional troubleshooting tips.

YOLOv3 Test

Assuming you were able to complete the Intel® Distribution of OpenVINO™ toolkit installation and run the samples as described in “Install the Intel® Distribution of OpenVINO™ Toolkit for Raspbian OS”, you may want to check out this project on GitHub*. The following steps will help you get YOLOv3 running on your Raspberry Pi NCS2-enabled system:

Figure 4. Test setup

  1. Connect a USB webcam to the Raspberry Pi board. For reference, our test setup is shown in Figure 4.
  2. Clone the open source repository:
    cd ~
    git clone https://github.com/PINTO0309/OpenVINO-YoloV3.git
    
  3. Download YOLOv3 models:
    cd ~/OpenVINO-YoloV3/lrmodels/YoloV3/FP16
    chmod +x download_yolov3lrFP16.sh
    sudo ./download_yolov3lrFP16.sh
    
  4. Next, we will run the openvino_yolov3_test.py script, but first we need to change the code to use the FP16 model. Open the openvino_yolov3_test.py script in your code editor of choice and make the change shown highlighted in Figure 5.

     

    Figure 5. Python* code change to specify FP16 model

  5. Save the script and then run it by entering the following commands in a terminal:
    cd ~/OpenVINO-YoloV3
    python3 openvino_yolov3_test.py –d MYRIAD

Summary

If you’ve been following along with the steps outlined in this paper then you should now have a functional Raspberry Pi 3 single board computer running the Intel® Distribution of OpenVINO™ toolkit with the Intel® Neural Compute Stick 2. For more information on the Intel® Distribution of OpenVINO™ toolkit, be sure to check out the Intel® Developer Zone Computer Vision Community Forum.

This document contains information on products, services and/or processes in development. All information provided here is subject to change without notice. Contact your Intel representative to obtain the latest forecast, schedule, specifications, and roadmaps.

The products and services described may contain defects or errors known as errata which may cause deviations from published specifications. Current characterized errata are available on request.

Copies of documents which have an order number and are referenced in this document may be obtained by calling 1-800-548-4725 or by visiting www.intel.com/design/literature.htm.

Para obtener información más completa sobre las optimizaciones del compilador, consulte nuestro Aviso de optimización.