In today’s world, where social distancing has become an essential practice, leveraging computer vision and artificial intelligence (AI) can play a vital role in monitoring and ensuring safe distancing measures. In this blog, we will showcase a Social Distancing Monitoring Demo using OpenVINO and Brainy Pi, a powerful combination for developers and entrepreneurs looking to build computer vision products. We will guide you through the installation process, compiling the demos, and running the demo application, allowing you to determine the distance between individuals in a video/camera-feed. Lets implement Social Distance Monitoring Product !
Installing OpenVINO
To begin, we need to install OpenVINO and its dependencies on BrainyPi. Open a terminal and run the following command:
sudo apt install openvino-toolkit libopencv-dev
This command will install OpenVINO and the necessary OpenCV development files on your system.
Compiling Demos
Once OpenVINO is installed, we can proceed to compile the demos. These demos provide a great starting point for understanding and exploring the capabilities of OpenVINO. Follow the steps below:
Set up the OpenVINO environment by sourcing the
setupvars.sh
script:source /opt/openvino/setupvars.sh
Clone the Open Model Zoo repository, which contains the demos, using the following command:
git clone --recurse-submodules https://github.com/openvinotoolkit/open_model_zoo.git cd open_model_zoo/demos/
Build the demos by executing the
build_demos.sh
script:./build_demos.sh
This will compile the demo applications and make them ready for execution.
Running the Demo for Social Distance Monitoring
With the demos compiled, we can now download the required models and run them using OpenVINO. Follow these steps:
Download the models needed for the demo by running the following command:
omz_downloader --list ~/open_model_zoo/demos/social_distance_demo/cpp/models.lst -o ~/models/ --precision FP16
Download the test video:
cd ~/ wget https://raw.githubusercontent.com/intel-iot-devkit/sample-videos/master/face-demographics-walking.mp4
Once the models and the test video are downloaded, you can run the object detection demo using the following command:
~/omz_demos_build/aarch64/Release/social_distance_demo -i ~/face-demographics-walking.mp4 -m_det ~/models/intel/person-detection-retail-0013/FP16/person-detection-retail-0013.xml -m_reid ~/models/intel/person-reidentification-retail-0277/FP16/person-reidentification-retail-0277.xml