How to install openVINO on ubuntu 18.04?

Vikas Kumar
Coding Blocks
Published in
4 min readFeb 25, 2020
OpenVINO

To install openVINO software First Install OpenCV and CMake

1- Before installing any software in Linux be sure to update your repositories with

$ sudo apt update && upgrade

2- Install the required dependencies:

$ sudo apt install build-essential cmake git pkg-config libgtk-3-dev \ libavcodec-dev libavformat-dev libswscale-dev libv4l-dev \ libxvidcore-dev libx264-dev libjpeg-dev libpng-dev libtiff-dev \ gfortran openexr libatlas-base-dev python3-dev python-numpy \ libtbb2 libtbb-dev libdc1394–22-dev

3- Create an opencv_build directory, cd into it and then clone the OpenCV and OpenCV contrib repositories:

$ mkdir ~/opencv_build && cd ~/opencv_build

$ git clone https://github.com/opencv/opencv.git

$ git clone https://github.com/opencv/opencv_contrib.git

4- Once the download is complete, create a build directory and cd into it:

$ cd ~/opencv_build/opencv

$ mkdir build && cd build

5- Now setup the build with CMake:

$ cmake -D CMAKE_BUILD_TYPE=RELEASE \ -D CMAKE_INSTALL_PREFIX=/usr/local \ -D INSTALL_C_EXAMPLES=ON \ -D INSTALL_PYTHON_EXAMPLES=ON \ -D OPENCV_GENERATE_PKGCONFIG=ON \ -D OPENCV_EXTRA_MODULES_PATH=~/opencv_build/opencv_contrib/modules \ -D BUILD_EXAMPLES=ON ..

6- Start compiling with the make and then install, then verify if it was installed correctly:

$ make -j(number of cores your CPU has), e.g. make -j2 or make -j4

$ sudo make install

$ python3 -c "import cv2; print(cv2.__version__)

Now to install OpenVINO

To install OpenVINO, I consulted the official documentation here:

I will summarize the steps here to help you

1- Make sure to download OpenVINO from the link I provided. Register when prompted. Also, keep the serial number given to you.

2- Change directories to your downloads directory with $ cd ~/Downloads

3- The file is saved in the directory as l_openvino_toolkit_p_<version>.tgz

4- Untar the file using the following command:

$ tar -xvf l_openvino_toolkit_p_<version>.tgz

5- Then move into the l_openvino_toolkit_p_<version> directory:

$ cd l_openvino_toolkit_p_<version>

6- Now, you can install either using a GUI or CLI Installation using the following commands:

$ sudo ./install.sh

or

$ sudo ./install_GUI.sh

7- Follow the onscreen instructions and it will tell you what needs to be installed or what you will be prompted to install later.

8- You can customize or choose a default installation. Choose default if you’re new to this.

9- Openvino will be installed on the /opt/intel/openvino_<version>

directory

10- The first part of the installation will be complete, next you have to set up the variables, configure the model optimizer and add dependencies.

11- Change to the install_dependencies directory with $ cd /opt/intel/openvino/install_dependencies

12- Run the script to download the needed dependencies with the following:

$ sudo -E ./install_openvino_dependencies.sh

13- Next set your variables with the

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

Optionally you can add it to your .bashrc file in the last line. Use nano or vi to edit the file. Just add that line at the end and source it.

14- Next, configure the model optimizer by changing to the prerequisites directory with $ cd /opt/intel/openvino/deployment_tools/model_optimizer/install_prerequisites to start the process. Then run the script to configure the model optimizer with $ sudo ./install_prerequisites.sh. If you want to install only a specified model use the $ sudo ./install_prequisites_<model name>.sh command instead.

15- To verify installation, go to the Inference Engine demo directory with $ cd /opt/intel/openvino/deployment_tools/demo.

16- Then run the image classification verification script with $ ./demo_squeezenet_download_convert_run.sh.

17- If it says execution successful then it has run correctly.

18- Next, run the Inference Pipeline verification script with $ ./demo_security_barrier_camera.sh. When it completes you should get an image that displays the resulting frame with detections rendered as bounding boxes and text. Your framerate will vary depending on the machine you have. Close the window to verify the installation.

Img src = https://docs.openvinotoolkit.org/latest/inference_pipeline_script_lnx.png

18- Congratulations, you have installed OpenVINO.

Do clap 👏🏻👏🏻 50 times and share the article if you like it. Thank you for giving your valuable time :)

--

--

Vikas Kumar
Coding Blocks

Android Developer | Actions on Google | GCP | Tech-Blogger | Mentor | Open Source Contributor| CA at Coding Blocks