The Intel Distribution of OpenVINO toolkit makes it simple to adopt and maintain your code. The runtime (inference engine) allows you to tune for performance by compiling the optimized network and managing inference operations on specific devices.
This guide provides users with steps for creating a Docker* image to install the OpenVINO™ toolkit for Raspbian* OS.
Target operating system
Host operating systems
Hardware
uname -m
returns armv7l
. Software
Note | Use the automated convenience scripts to install Docker*, as this is currently the only way to install this toolkit for Raspbian*. Find more information. |
Build image
To build a Docker* image, you'll need to create a Dockerfile that contains the defined variables and commands required to create an OpenVINO™ toolkit installation image.
Create your Dockerfile using the following example as a template.
mkdir ~/docker && cd ~/docker
vi Dockerfile
FROM balenalib/raspberrypi3:buster
ARG DOWNLOAD_LINK=https://github.com/openvinotoolkit/openvino/releases/download/2022.2.0/l_openvino_toolkit_debian9_arm_2022.2.0.7713.af16ea1d79a_x86_64.tgz
ARG INSTALL_DIR=/opt/intel/openvino
ARG BIN_FILE=https://storage.openvinotoolkit.org/repositories/open_model_zoo/2022.1/models_bin/3/person-vehicle-bike-detection-crossroad-0078/FP16/person-vehicle-bike-detection-crossroad-0078.bin
ARG WEIGHTS_FILE=https://storage.openvinotoolkit.org/repositories/open_model_zoo/2022.1/models_bin/3/person-vehicle-bike-detection-crossroad-0078/FP16/person-vehicle-bike-detection-crossroad-0078.xml
ARG IMAGE_FILE=https://cdn.pixabay.com/photo/2018/07/06/00/33/person-3519503_960_720.jpg
RUN apt-get --allow-unauthenticated upgrade
RUN apt-get update && apt-get install -y --no-install-recommends \
apt-utils \
automake \
cmake \
cpio \
gcc \
g++ \
libatlas-base-dev \
libstdc++6 \
libtool \
libusb-1.0.0-dev \
lsb-release \
make \
python3-pip \
python3-numpy \
python3-scipy \
libgtk-3-0 \
pkg-config \
libavcodec-dev \
libavformat-dev \
libswscale-dev \
sudo \
udev \
unzip \
vim \
git \
wget && \
rm -rf /var/lib/apt/lists/*
RUN mkdir -p $INSTALL_DIR && cd $INSTALL_DIR && \
wget -c $DOWNLOAD_LINK && \
tar xf l_openvino_toolkit_debian9_arm*.tgz --strip 1 -C $INSTALL_DIR
# add USB rules
RUN sudo usermod -a -G users "$(whoami)"
# build Object Detection sample
RUN /bin/bash -c "source $INSTALL_DIR/setupvars.sh && \
cd $INSTALL_DIR/install_dependencies && \
sh install_NCS_udev_rules.sh"
RUN echo "source /opt/intel/openvino/setupvars.sh" >> ~/.bashrc && \
mkdir /root/Downloads && \
cd $INSTALL_DIR/samples/c/ && \
/bin/bash -c "source $INSTALL_DIR/setupvars.sh && \
./build_samples.sh && \
cd $INSTALL_DIR/samples/cpp/ && \
./build_samples.sh && \
wget --no-check-certificate $BIN_FILE -O /root/Downloads/person-vehicle-bike-detection-crossroad-0078.bin && \
wget --no-check-certificate $WEIGHTS_FILE -O /root/Downloads/person-vehicle-bike-detection-crossroad-0078.xml && \
wget --no-check-certificate $IMAGE_FILE -O /root/Downloads/walk.jpg "
Note | You will need to replace the direct link to the OpenVINO™ toolkit package in the DOWNLOAD_LINK variable in the template above with that of the latest version. You can copy the link of the OpenVINO toolkit for Raspbian* OS package (i.e. l_openvino_toolkit_debian9_arm_*_x86_64.tgz) from https://storage.openvinotoolkit.org. Select the latest version available, right-click the URL, and press Copy link address. |
docker build . -t <image_name>
(for example, docker build . -t openvino-rpi)
Known limitations:
Running Benchmark App
The application works with models in the OpenVINO IR (model.xml and model.bin) and ONNX (model.onnx) formats. Make sure to convert your models if necessary.
docker run -it --privileged -v /dev:/dev --network=host <image_name> /bin/bash
(
for example,
docker run -it --privileged -v /dev:/dev --network=host openvino-rpi /bin/bash)
cd /root/inference_engine_._samples_build/armv7l/Release/
./benchmark_app -m ~/Downloads/person-vehicle-bike-detection-crossroad-0078.xml -i ~/Downloads/walk.jpg -d MYRIAD
This completes the installation procedure for the OpenVINO™ toolkit for Raspbian* from a Docker* image.
Note | This applies to 2022.2 release of OpenVINO™ toolkit. |