Install Intel® Distribution of OpenVINO™ toolkit for Linux*

NOTES:

Introduction

The Intel® Distribution of OpenVINO™ toolkit quickly deploys applications and solutions that emulate human vision. Based on Convolutional Neural Networks (CNN), the toolkit extends computer vision (CV) workloads across Intel® hardware, maximizing performance. The Intel® Distribution of OpenVINO™ toolkit includes the Intel® Deep Learning Deployment Toolkit (Intel® DLDT).

The Intel® Distribution of OpenVINO™ toolkit for Linux*:

Included with the Installation and installed by default:

Component Description
Model Optimizer This tool imports, converts, and optimizes models that were trained in popular frameworks to a format usable by Intel tools, especially the Inference Engine. 
Popular frameworks include Caffe*, TensorFlow*, MXNet*, and ONNX*.
Inference Engine This is the engine that runs the deep learning model. It includes a set of libraries for an easy inference integration into your applications.
Drivers and runtimes for OpenCL™ version 2.1 Enables OpenCL on the GPU/CPU for Intel® processors
Intel® Media SDK Offers access to hardware accelerated video codecs and frame processing
OpenCV OpenCV* community version compiled for Intel® hardware
OpenVX* version 1.1 Intel's implementation of OpenVX* 1.1 optimized for running on Intel® hardware (CPU, GPU, IPU)
Sample Applications A set of simple console applications demonstrating how to use the Inference Engine in your applications
Demos A set of console applications that demonstrate how you can use the Inference Engine in your applications to solve specific use-cases
Additional Tools A set of tools to work with your models
Documentation for Pre-Trained Models Documentation for the pre-trained models available in the Open Model Zoo repo

Development and Target Platform

The development and target platforms have the same requirements, but you can select different components during the installation, based on your intended use.

Hardware

Processor Notes:

Operating Systems

Overview

This guide provides step-by-step instructions on how to install the Intel® Distribution of OpenVINO™ toolkit. Links are provided for each type of compatible hardware including downloads, initialization and configuration steps. The following steps will be covered:

  1. Install the Intel® Distribution of OpenVINO™ Toolkit
  2. Install External software dependencies
  3. Set the OpenVINO™ Environment Variables: Optional Update to .bashrc.
  4. Configure the Model Optimizer
  5. Run the Verification Scripts to Verify Installation and Compile Samples
  6. Steps for Intel® Processor Graphics (GPU)
  7. Steps for Intel® Movidius™ Neural Compute Stick and Intel® Neural Compute Stick 2
  8. Steps for Intel® Vision Accelerator Design with Intel® Movidius™ VPU
    After installing your Intel® Movidius™ VPU, you will return to this guide to complete OpenVINO™ installation.
  9. Run a Sample Application
  10. Use the Face Detection Tutorial

Install the Intel® Distribution of OpenVINO™ Toolkit Core Components

Download the Intel® Distribution of OpenVINO™ toolkit package file from Intel® Distribution of OpenVINO™ toolkit for Linux*. Select the Intel® Distribution of OpenVINO™ toolkit for Linux package from the dropdown menu.

  1. Open a command prompt terminal window.
  2. Change directories to where you downloaded the Intel Distribution of OpenVINO toolkit for Linux* package file.
    If you downloaded the package file to the current user's Downloads directory:
    cd ~/Downloads/
    By default, the file is saved as l_openvino_toolkit_p_<version>.tgz.
  3. Unpack the .tgz file:
    tar -xvzf l_openvino_toolkit_p_<version>.tgz
    The files are unpacked to the l_openvino_toolkit_p_<version> directory.
  4. Go to the l_openvino_toolkit_p_<version> directory:
    cd l_openvino_toolkit_p_<version>
    If you have a previous version of the Intel Distribution of OpenVINO toolkit installed, rename or delete these two directories:

Installation Notes:

  1. Choose your installation option:
    • Option 1: GUI Installation Wizard:
      sudo ./install_GUI.sh
    • Option 2: Command-Line Instructions:
      sudo ./install.sh
  2. Follow the instructions on your screen. Watch for informational messages such as the following in case you must complete additional steps:
    openvino-install-linux-01.png
  3. If you select the default options, the Installation summary GUI screen looks like this:
    openvino-install-linux-02.png
    • Optional: You can choose Customize to change the installation directory or the components you want to install:
      openvino-install-linux-04.png
      When installed as root the default installation directory for the Intel Distribution of OpenVINO is /opt/intel/openvino_<version>/.
      For simplicity, a symbolic link to the latest installation is also created: /opt/intel/openvino/.

      NOTE: The Intel® Media SDK component is always installed in the /opt/intel/mediasdk directory regardless of the OpenVINO installation path chosen.

  4. A Complete screen indicates that the core components have been installed:
openvino-install-linux-03.png

The first core components are installed. Continue to the next section to install additional dependencies.

Install External Software Dependencies

NOTE: If you installed the Intel® Distribution of OpenVINO™ to the non-default install directory, replace /opt/intel with the directory in which you installed the software.

These dependencies are required for:

  1. Change to the install_dependencies directory:
    cd /opt/intel/openvino/install_dependencies
  2. Run a script to download and install the external software dependencies:
    sudo -E ./install_openvino_dependencies.sh
    The dependencies are installed. Continue to the next section to set your environment variables.

Set the Environment Variables

You must update several environment variables before you can compile and run OpenVINO™ applications. Run the following script to temporarily set your environment variables:

source /opt/intel/openvino/bin/setupvars.sh

Optional: The OpenVINO environment variables are removed when you close the shell. As an option, you can permanently set the environment variables as follows:

  1. Open the .bashrc file in <user_directory>:
    vi <user_directory>/.bashrc
  2. Add this line to the end of the file:
    source /opt/intel/openvino/bin/setupvars.sh
  3. Save and close the file: press the Esc key and type :wq.
  4. To test your change, open a new terminal. You will see [setupvars.sh] OpenVINO environment initialized.

The environment variables are set. Continue to the next section to configure the Model Optimizer.

Configure the Model Optimizer

The Model Optimizer is a Python*-based command line tool for importing trained models from popular deep learning frameworks such as Caffe*, TensorFlow*, Apache MXNet*, ONNX* and Kaldi*.

The Model Optimizer is a key component of the Intel Distribution of OpenVINO toolkit. You cannot perform inference on your trained model without running the model through the Model Optimizer. When you run a pre-trained model through the Model Optimizer, your output is an Intermediate Representation (IR) of the network. The Intermediate Representation is a pair of files that describe the whole model:

For more information about the Model Optimizer, refer to the Model Optimizer Developer Guide

Model Optimizer Configuration Steps

You can choose to either configure all supported frameworks at once OR configure one framework at a time. Choose the option that best suits your needs. If you see error messages, make sure you installed all dependencies.

NOTE: Since the TensorFlow framework is not officially supported on CentOS*, the Model Optimizer for TensorFlow can't be configured and ran on those systems.

IMPORTANT: The Internet access is required to execute the following steps successfully. If you have access to the Internet through the proxy server only, please make sure that it is configured in your OS environment.

Option 1: Configure all supported frameworks at the same time

  1. Go to the Model Optimizer prerequisites directory:
    cd /opt/intel/openvino/deployment_tools/model_optimizer/install_prerequisites
  2. Run the script to configure the Model Optimizer for Caffe, TensorFlow, MXNet, Kaldi*, and ONNX:
    sudo ./install_prerequisites.sh

Option 2: Configure each framework separately

Configure individual frameworks separately ONLY if you did not select Option 1 above.

  1. Go to the Model Optimizer prerequisites directory:
    cd /opt/intel/openvino/deployment_tools/model_optimizer/install_prerequisites
  2. Run the script for your model framework. You can run more than one script:
    • For Caffe:
      sudo ./install_prerequisites_caffe.sh
    • For TensorFlow:
      sudo ./install_prerequisites_tf.sh
    • For MXNet:
      sudo ./install_prerequisites_mxnet.sh
    • For ONNX:
      sudo ./install_prerequisites_onnx.sh
    • For Kaldi:
      sudo ./install_prerequisites_kaldi.sh
      The Model Optimizer is configured for one or more frameworks.

You are ready to compile the samples by running the verification scripts.

Run the Verification Scripts to Verify Installation

IMPORTANT: This section is required. In addition to confirming your installation was successful, demo scripts perform other steps, such as setting up your computer to use the Inference Engine samples.

To verify the installation and compile two samples, run the verification applications provided with the product on the CPU:

  1. Go to the Inference Engine demo directory:
    cd /opt/intel/openvino/deployment_tools/demo
  2. Run the Image Classification verification script:
    ./demo_squeezenet_download_convert_run.sh
    This verification script downloads a SqueezeNet model, uses the Model Optimizer to convert the model to the .bin and .xml Intermediate Representation (IR) files. The Inference Engine requires this model conversion so it can use the IR as input and achieve optimum performance on Intel hardware.
    This verification script builds the Image Classification Sample application and run it with the car.png image located in the demo directory. When the verification script completes, you will have the label and confidence for the top-10 categories:
    image_classification_script_output_lnx.png
  3. Run the Inference Pipeline verification script:

    ./demo_security_barrier_camera.sh

    This script downloads three pre-trained models IRs, builds the Security Barrier Camera Demo application and run it with the downloaded models and the car_1.bmp image from the demo directory to show an inference pipeline. The verification script uses vehicle recognition in which vehicle attributes build on each other to narrow in on a specific attribute.

    First, an object is identified as a vehicle. This identification is used as input to the next model, which identifies specific vehicle attributes, including the license plate. Finally, the attributes identified as the license plate are used as input to the third model, which recognizes specific characters in the license plate.

    When the verification script completes, you will see an image that displays the resulting frame with detections rendered as bounding boxes, and text:

    inference_pipeline_script_lnx.png
  4. Close the image viewer window to complete the verification script.

To learn about the verification scripts, see the README.txt file in /opt/intel/openvino/deployment_tools/demo.

For a description of the Intel Distribution of OpenVINO™ pre-trained object detection and object recognition models, see Overview of OpenVINO™ Toolkit Pre-Trained Models.

You have completed all required installation, configuration and build steps in this guide to use your CPU to work with your trained models. To use other hardware, see;

Steps for Intel® Processor Graphics (GPU)

The steps in this section are required only if you want to enable the toolkit components to use processor graphics (GPU) on your system.

  1. Go to the install_dependencies directory:
    cd /opt/intel/openvino/install_dependencies/
  2. Enter the super user mode:
    sudo -E su
  3. Install the Intel® Graphics Compute Runtime for OpenCL™ driver components required to use the GPU plugin and write custom layers for Intel® Integrated Graphics:
    ./install_NEO_OCL_driver.sh
    You may see the following command line output:

Ignore those suggestions and continue.

  1. Optional Install header files to allow compiling a new code. You can find the header files at Khronos OpenCL™ API Headers.

Steps for Intel® Movidius™ Neural Compute Stick and Intel® Neural Compute Stick 2

These steps are only required if you want to perform inference on Intel® Movidius™ NCS powered by the Intel® Movidius™ Myriad™ 2 VPU or Intel® Neural Compute Stick 2 powered by the Intel® Movidius™ Myriad™ X VPU. See also the Get Started page for Intel® Neural Compute Stick 2:

  1. Add the current Linux user to the users group:
    sudo usermod -a -G users "$(whoami)"
    Log out and log in for it to take effect.
  2. To perform inference on Intel® Movidius™ Neural Compute Stick and Intel® Neural Compute Stick 2, install the USB rules as follows:
    sudo cp /opt/intel/openvino/inference_engine/external/97-myriad-usbboot.rules /etc/udev/rules.d/
    sudo udevadm control --reload-rules
    sudo udevadm trigger
    sudo ldconfig

Steps for Intel® Vision Accelerator Design with Intel® Movidius™ VPU

To install and configure your Intel® Vision Accelerator Design with Intel® Movidius™ VPU see the Intel® Vision Accelerator Design with Intel® Movidius™ VPUs Configuration Guide

NOTE: After installing your Intel® Movidius™ VPU, you will return to this guide to complete OpenVINO™ installation.

After configuration is done, you are ready to run the verification scripts with the HDDL Plugin for your Intel® Vision Accelerator Design with Intel® Movidius™ VPUs:

  1. Go to the Inference Engine demo directory:
    cd /opt/intel/openvino/deployment_tools/demo
  2. Run the Image Classification verification script. If you have access to the Internet through the proxy server only, please make sure that it is configured in your OS environment.
    ./demo_squeezenet_download_convert_run.sh -d HDDL
  3. Run the Inference Pipeline verification script:
    ./demo_security_barrier_camera.sh -d HDDL

Run a Sample Application

In this section you will run the Image Classification Sample Application with a Squeezenet1.1 Caffe* model on three types of Intel® hardware: CPU, GPU and VPU.

IMPORTANT: This section requires that you have Run the Verification Scripts to Verify Installation. This script builds the Image Classification sample application and downloads the required Caffe* Squeezenet model.

Setting up a neural network is the first step in running the sample.

Set Up a Neural Network Model

If you are running inference on hardware other than VPU-based devices, you already have the required FP32 neural network model converted to an optimized Intermediate Representation (IR). Follow the steps in the Run the Sample Application section to run the sample.

If you want to run inference on a VPU device (Intel® Movidius™ Neural Compute Stick, Intel® Neural Compute Stick 2 or Intel® Vision Accelerator Design with Intel® Movidius™ VPU), you'll need an FP16 version of the model, which you will set up in this paragraph.

To convert the FP32 model to a FP16 IR suitable for VPU-based hardware accelerators, follow the steps below:

  1. Make a directory for the FP16 SqueezeNet Model:
    mkdir /home/<user>/squeezenet1.1_FP16
  2. Go to /home/<user>/squeezenet1.1_FP16:
    cd /home/<user>/squeezenet1.1_FP16
  3. Run the Model Optimizer to convert the FP32 Squeezenet Caffe* model delivered with the installation into an optimized FP16 Intermediate Representation (IR):
    python3 /opt/intel/openvino/deployment_tools/model_optimizer/mo.py --input_model /home/<user>/openvino_models/models/FP32/classification/squeezenet/1.1/caffe/squeezenet1.1.caffemodel --data_type FP16 --output_dir .
  4. The squeezenet1.1.labels file contains the classes that ImageNet uses. This file is included so that the inference results show text instead of classification numbers. Copy squeezenet1.1.labels to your optimized model location:
    cp /home/<user>/openvino_models/ir/FP32/classification/squeezenet/1.1/caffe/squeezenet1.1.labels .

Now your neural network setup is complete and you're ready to run the sample application.

Run the Sample Application

In this paragraph you will run the Image Classification sample application, which was automatically built when you Ran the Image Classification Verification Script. To run the sample application:

  1. Go to the samples build directory:
    cd ~/inference_engine_samples_build/intel64/Release
  2. Run the sample executable with specifying the car.png file from the demo directory as an input image, the IR of your FP16 model and a plugin for a hardware device to perform inference on.

    NOTE: Running the sample application on hardware other than CPU requires performing additional hardware configuration steps.

    • For CPU:
      classification_sample.exe -i /opt/intel/openvino/deployment_tools/demo/car.png -m /home/<user>/squeezenet1.1_FP16/squeezenet1.1.xml -d CPU
    • For GPU:
      classification_sample.exe -i /opt/intel/openvino/deployment_tools/demo/car.png -m /home/<user>/squeezenet1.1_FP16/squeezenet1.1.xml -d GPU
    • For MYRIAD:

      NOTE: Running inference on Intel® Movidius™ Neural Compute Stick or Intel® Neural Compute Stick 2 with the MYRIAD plugin requires performing additional hardware configuration steps.

      classification_sample.exe -i /opt/intel/openvino/deployment_tools/demo/car.png -m /home/<user>/squeezenet1.1_FP16/squeezenet1.1.xml -d MYRIAD
    • For HDDL:

      NOTE: Running inference on Intel® Vision Accelerator Design with Intel® Movidius™ VPUs with the HDDL plugin requires performing additional hardware configuration steps

      classification_sample.exe -i /opt/intel/openvino/deployment_tools/demo/car.png -m /home/<user>/squeezenet1.1_FP16/squeezenet1.1.xml -d HDDL

For information on Sample Applications, see the Inference Engine Samples Overview.

Congratulations, you have finished the installation of the Intel® Distribution of OpenVINO™ toolkit for Linux*. To learn more about how the Intel® Distribution of OpenVINO™ toolkit works, the Hello World tutorial and other resources are provided below.

Hello World Face Detection Tutorial

See the OpenVINO™ Hello World Face Detection Exercise.

Additional Resources

To learn more about converting models, go to: