Start OpenVINO™ toolkit Python Application at Boot Time using System Service on Raspbian* OS


Install & Setup




This guide provides users with steps for creating a system service to initialize OpenVINO™ toolkit environment variables and run the Python application for Raspbian*. This process may apply to other Linux* distributions but this guide was written to work for Raspbian* OS.

The steps below assume you have OpenVINO™ toolkit installed and that your installation has been verified. If you have not yet done so, please visit the following links:

System Requirements

  • Raspbian* Buster, 32-bit

Steps to Create System Service File

  1. Install tools and download necessary files:

    sudo pip install progress
    cd ~/

    wget -O ~/Downloads/person-vehicle-bike-detection-crossroad-0078.bin
    wget -O ~/Downloads/person-vehicle-bike-detection-crossroad-0078.xml
    wget -O ~/Downloads/people-detection.mp4

  2. Create bash script to initialize OpenVINO* environment variables and execute python script:

    vi ~/openvino-object-detection-demo-script

    source /home/pi/openvino_dist/
    /usr/bin/python3 /home/pi/openvino_dist/extras/open_model_zoo/demos/object_detection_demo/python/ -i /home/pi/Downloads/people-detection.mp4 -m /home/pi/Downloads/person-vehicle-bike-detection-crossroad-0078.xml -d MYRIAD -at ssd

  3. Change bash script file permissions and ownership:

    chmod u+x ~/openvino-object-detection-demo-script

  4. Create service file under /etc/systemd/system with contents as shown below:

    sudo vi /etc/systemd/system/openvino-object-detection-demo.service

    Description=Init OpenVINO env and run python object detection demo



  5. Enable system service to start at boot and start system service:

    sudo systemctl enable openvino-object-detection-demo.service
    sudo systemctl start openvino-object-detection-demo.service

  6. To check system service status:

    sudo systemctl status openvino-object-detection-demo.service

  7. Or to disable service during boot time, first stop service and then disable service:

    sudo systemctl stop openvino-object-detection-demo.service
    sudo systemctl disable openvino-object-detection-demo.service

For more information about system service for Linux*, please take a look at the manual page for systemd.

man systemd