适用于 Raspbian* OS 程序包的 OpenVINO™ 工具套件不包括 Open Model Zoo 中的演示应用程序。这些演示可从 Open Model Zoo GitHub 存储库单独下载。
注意 | 在安装 Open Model Zoo 演示之前,本文假设您已完成了以下操作之一:
|
如果安装了适用于 Raspbian* OS 的 OpenVINO™ 工具套件 的预构建程序包,运行以下命令:
source /opt/intel/openvino/bin/setupvars.sh
如果您构建了开源OpenVINO™ Raspbian* OS 的工具套件运行以下命令:
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
注意 | 如果使用 Python* 的不同版本, PYTHONPATH 变量可能会有所不同,所以请确保此变量与您构建的环境匹配。 |
cd ~
git clone --recurse-submodules --single-branch --branch 2022.1.0 https://github.com/openvinotoolkit/open_model_zoo.git
cd ~/open_model_zoo/demos
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
运行 make help,以列出可用选项:
make help
您可以选择构建单独演示,方法是指定演示名称,例如:
make object_detection_demo
或使用下列命令来构建所有演示:
make all
构建过程完成后,您可以在 ~/open_model_zoo/demos/build/armv7l/Release 目录中找到演示的二进制文件。
如需运行某个演示应用程序,需要一个模型和输入视频。按照下面说明的步骤来运行 object_detection_demo。
要下载示例视频,请运行以下命令:
cd ~/Downloads
wget https://github.com/intel-iot-devkit/sample-videos/raw/master/person-bicycle-car-detection.mp4
要从 download.01.org 直接下载模型,使用以下命令来获取人车对自行车的检测模型:
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
注意 | 英特尔® NCS2需要针对 16 位浮点格式(称为 FP16)进行优化的模型。如果您的模型与示例不同,则您可能需要使用模型优化器来将其转换为 FP16。 |
运行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
运行 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
如需有关此演示及其他演示的详细信息,请使用 -h 标记,例如:
./object_detection_demo -h
在 Raspberry Pi* OS 上安装 Open Model Zoo 演示的程序已完成。