People Counter and Vehicle Counter on Brainy Pi Using Edge AI

by SohamShinde in Circuits > Raspberry Pi

247 Views, 0 Favorites, 0 Comments

People Counter and Vehicle Counter on Brainy Pi Using Edge AI

ii.png

In simple words, Edge AI refers to the use of artificial intelligence technologies on network edge devices such as smartphones, IoT devices, and gateways rather than in the cloud or data center. Here the edge device used is the Brainy Pi.

In this project we have implemented a vehicle counter model and a people counter model on Brainy Pi.

I had applied for an early access to BrainyPi as it is right now available for selected audience only.

Also the reference documentation which I used is here.

Supplies

b.png
  • Brainy Pi
  • UNIX OS Terminal

Remote Connection to Brainy Pi

Screenshot (407).png

Secure a remote connection to the brainy pi using the command,

ssh -X pi@auth.iotiot.in -p 65530


After entering the password, a remote connection is established on the terminal.

Cloning the Git Repository

The next step is to clone the git repo of the project for running the python script, the command for it is as follows,

git clone https://github.com/brainypi/BrainyPi-AI-Examples.git
  • Change working directory to the project's directory by using cd command,
cd BrainyPi-AI-Examples/Pytorch/vehicle-counter

Run Model File for People Counter

WhatsApp Image 2023-01-23 at 10.06.16 PM.jpeg
WhatsApp Image 2023-01-23 at 10.06.16 PM (1).jpeg

Ran the python script people_counter.py which takes input from vide.mp4 using command,

python people_counter.py mb1-ssd models/mobilenet-v1-ssd-mp-0_675.pth models/voc-model-labels.txt video.mp4
  • It displays the number of people in the video as well as highlights them with a box.

Run Model File for Vehicle Counter

WhatsApp Image 2023-01-23 at 10.06.16 PM (2).jpeg
  • For this model, first change the working directory to vehicle counter directory.
  • Type the command to run vehicle_counter.py using command,
python vehicle_counter.py mb1-ssd models/mobilenet-v1-ssd-mp-0_675.pth models/voc-model-labels.txt video.mp4
  • The number of vehicles detected by the algorithm is displayed as the output.
  • The vehicles detected are also highlighted using squares.