Diese Anleitung bietet Benutzern Schritte zum Erstellen eines Systemdienstes, um OpenVINO™ Toolkit-Umgebungsvariablen zu initialisieren und die benchmark_app.py Python-Anwendung für Raspbian* auszuführen. Dieser Prozess kann auch für andere Linux*-Distributionen gelten, aber dieses Handbuch wurde geschrieben, um für Raspbian* OS zu funktionieren.
Bei den folgenden Schritten wird davon ausgegangen, dass Sie OpenVINO™ Toolkit installiert haben und dass Ihre Installation überprüft wurde. Falls Sie dies noch nicht getan haben, besuchen Sie bitte die folgenden Links:
sudo pip install progress
cd ~/
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 -O ~/Downloads/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 -O ~/Downloads/person-vehicle-bike-detection-crossroad-0078.xml
wget https://github.com/intel-iot-devkit/sample-videos/raw/master/people-detection.mp4 -O ~/Downloads/people-detection.mp4
vi ~/openvino-object-detection-demo-script
#!/bin/bash
Quelle /home/pi/openvino_dist/setupvars.sh
/usr/bin/python3 /home/pi/openvino_dist/extras/open_model_zoo/demos/object_detection_demo/python/object_detection_demo.py -i /home/pi/Downloads/people-detection.mp4 -m /home/pi/Downloads/person-vehicle-bike-detection-crossroad-0078.xml -d MYRIAD -at ssd
chmod u+x ~/openvino-object-detection-demo-script
sudo vi /etc/systemd/system/openvino-object-detection-demo.service
[Unit]
Description=Init OpenVINO env and run python object detection demo
After=network.target
[Service]
ExecStart=/home/pi/openvino-object-detection-demo-script
WorkingDirectory=/home/pi
StandardOutput=inherit
StandardError=inherit
Restart=on-failure
User=pi
[Install]
WantedBy=multi-user.target
sudo systemctl enable openvino-object-detection-demo.service
sudo systemctl start openvino-object-detection-demo.service
sudo systemctl status openvino-object-detection-demo.service
sudo systemctl stop openvino-object-detection-demo.service
sudo systemctl disable openvino-object-detection-demo.service
Weitere Informationen zum Systemservice für Linux* finden Sie auf der Handbuchseite für systemd.
man systemd