Building Open Model Zoo Demos on Raspberry Pi*
The OpenVINO™ Toolkit for the Raspbian* OS package does not include the demo applications found in Open Model Zoo. These demos can be downloaded separately from the Open Model Zoo GitHub repository.
Note | Prior to installing the Open Model Zoo demos, this article assumes you performed one of the following:
|
Set Environment Variables
If the pre-built package of OpenVINO™ Toolkit for Raspbian* OS is installed, run the following commands:
source /opt/intel/openvino/bin/setupvars.sh
If you built the Open Source OpenVINO™ Toolkit for Raspbian* OS run the following commands:
export InferenceEngine_DIR=/home/pi/openvino/build/
export OpenVINO_DIR=/home/pi/openvino/build/
export PYTHONPATH=/home/pi/openvino/bin/armv7l/Release/lib/python_api/python3.7/
export LD_LIBRARY_PATH=/home/pi/openvino/bin/armv7l/Release/lib/
export OpenCV_DIR=/usr/local/lib/cmake/opencv4
Note | The PYTHONPATH variable may differ if using a different version of Python*, please make sure this variable matches your built environment. |
How to Install
- Clone the Open Model Zoo repository to your home directory:
cd ~
git clone --recurse-submodules --single-branch --branch 2022.1.0 https://github.com/openvinotoolkit/open_model_zoo.git
- Navigate to the demos directory and create a build directory:
cd ~/open_model_zoo/demos
mkdir build && cd build
- Configure cmake to build the demos for Raspberry Pi*:
cmake -DCMAKE_BUILD_TYPE=Release ..
-
Run make help to list available options:
make help
You can choose to build individual demos by specifying the demo name, for example:
make object_detection_demo
Or use the following command to build all the demos:
make all
After the build process is completed, you can find the demo binaries in the ~/open_model_zoo/demos/build/armv7l/Release directory.
Run a Demo Application
In order to run one of the demo applications, a model and input video is required. Follow the steps noted below to run the object_detection_demo.
To download a sample video run the following commands:
cd ~/Downloads
wget https://github.com/intel-iot-devkit/sample-videos/raw/master/person-bicycle-car-detection.mp4
To download a model directly from download.01.org, use the following commands to grab a person-vehicle-bike detection model:
cd ~/Downloads
wget 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
wget 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
Note | The Intel® NCS2 requires models that are optimized for the 16-bit floating point format known as FP16. Your model, if it differs from the example, may require conversion using the Model Optimizer to FP16. |
Running object_detection_demo:
cd ~/open_model_zoo/demos/build/armv7l/Release
./object_detection_demo -i ~/Downloads/person-bicycle-car-detection.mp4 -m ~/Downloads/person-vehicle-bike-detection-crossroad-0078.xml -at ssd -d MYRIAD
Running object_detection_demo for Python:
cd ~/open_model_zoo/demos/python_demos/object_detection_demo/
python3 object_detection_demo.py -i ~/Downloads/person-bicycle-car-detection.mp4 -m ~/Downloads/person-vehicle-bike-detection-crossroad-0078.xml -at ssd -d MYRIAD
For more information on this and other demos use the -h flag, for example:
./object_detection_demo -h
This completes the installation procedure for the Open Model Zoo Demos on Raspberry Pi* OS.