Getting Started
This document will guide you through the process of installing OpenVINO™ Toolkit and OpenVINO™ Notebooks.
This content is written targeting OpenVINO™ Toolkit 2023.3 LTS, which is the latest LTS version at the time of writing (July 5, 2024).
This time, Ubuntu 22.04 LTS was used as the OS and ADLINK SMARC hardware was used.
This procedure is based on the github ULR of Intel® Distribution of OpenVINO™ Toolkit and OpenVINO™ Notebooks below.
Reference:
- Intel® Distribution of OpenVINO™ Toolkit
- OpenVINO™ Notebooks github
- Ubuntu 22.04 LTS environment on ADLINK SMARC LEC-EL with Intel® 6th generation Atom® x6000 processor (Elkhart Lake)
<Products used in this project
-
I-Pi SMARC Elkhart Lake (I-Pi SMARC Plus carrier, ADLINK SMARC LEC-EL module, 4GB LPDDR4, 64GB eMMC)
I-Pi SMARC development kit based on Intel® 6th generation Atom® x6000 processor
Preliminary Preparation
STEP 1-1 :
Install Ubuntu 22.04 and run apt-get update and apt-get upgrade.
sudo apt-get update
sudo apt-get upgrade
STEP 1-2 : Install Python on Ubuntu 22.04.
Install Python 3.10 and vennv virtual environment on Ubuntu.
sudo apt install python3.10-venv
2. Install OpenVINO™ Toolkit 2023.3 LTS
Download and install OpenVINO™ using the Intel® Distribution of OpenVINO™ Toolkit link.
This time, we will use the PIP method, which is the easiest way to install OpenVINO™ Toolkit, so select as shown in the capture below.
Package : OpenVINO Base Package OpenVINO Base Package
Version : OpenVINO Base Package 2023.3 LTS
Operating System : Linux Linux
Distribution : PIP PIP
Copy and paste the necessary commands as shown in the screen below according to the selected Package, Version, Operating System, and Distribution, and execute them.
STEP 2-1 : Create a virtual environment.
python3 -m venv openvino_env
STEP 2-2 : Activate the virtual environment.
source openvino_env/bin/activate
STEP 2-3 : Upgrade pip to the latest version.
python -m pip install --upgrade pip
STEP 2-4 : Download and install the Development Tools, specifying the version.
pip install openvino-dev==2023.3.0
As shown below, a message will appear after executing the command. If no error occurs, the environment building is complete.
If the terminal window is closed, execute STEP 2-2 again to activate the OpenVINO™ virtual environment.
source openvino_env/bin/activate
3. Install and run OpenVINO™ Notebooks
Refer to the OpenVINO™ Notebooks Ubuntu link on the OpenVINO™ Notebooks github to install OpenVINO™ Notebooks.
STEP 3-1 : Deactivate the OpenVINO™ virtual environment and install additional libraries.
deactivate
sudo apt-get install python3-venv build-essential python3-dev git-all libgl1-mesa-dev ffmpeg
STEP 3-2: Activate the OpenVINO™ virtual environment.
source openvino_env/bin/activate
STEP 3-3 : Clone the repository.
git clone --depth=1 https://github.com/openvinotoolkit/openvino_notebooks.git
STEP 3-4 : Move to the openvino_notebooks directory by cd command.
cd openvino_notebooks
STEP 3-5 : Install packages such as dependencies.
pip install wheel setuptools
pip install -r requirements.txt
STEP 3-6 : Start all notebooks at once.
jupyter lab notebooks
You have successfully started the notebooks. Select "notebooks" from the sidebar on the left side of the screen.
Each notebook is located in a subdirectory of the notebooks directory.
STEP 3-7 : PyTorch to OpenVINO " example, but you can also specify a single notebooks to start.
jupyter lab notebooks/pytorch-to-openvino/pytorch-to-openvino.ipynb
You have successfully started the notebooks.
STEP 3-8 : Running Notebook
Basically, you can execute each step by simply clicking (Run) at the top.
This is the result of executing the sixth code from the top.
The results and inference time when the Pytorch model is used as is.
This is the result of running the 11th code from the top.
The results and inference times for the Pytorch model converted to the OpenVINO model and then inferred using the OpenVINO model.
You can see that the inference accuracy remains the same, but the inference time is faster.
This is the result when the 16th code from the top is executed.
After converting the Pytorch model to the OpenVINO model, the results and inference time are shown using the OpenVINO model.
The difference from the previous example is that the model is converted using the Static Input Shape instead of the Dynamic Input Shape.
We can see that the inference time is even faster with the Static Input Shape.
Conclusion
There are many notebooks available, but please refer to the following links to try it out.
Reference: