This system is able to detect and classify 4 different classes of vehicles including; car, motorcycle, bus and truck and count the number of vehicles in each classes as they pass through a virtual polygon area.
$ sudo systemctl disable nvzramconfig
$ sudo fallocate -l 4G /mnt/4GB.swap
$ sudo chmod 600 /mnt/4GB.swap
$ sudo mkswap /mnt/4GB.swap
$ sudo su
$ echo "/mnt/4GB.swap swap swap defaults 0 0" >> /etc/fstab
$ exit
REBOOT!
$ ./install_torch.sh
$ wget https://github.com/Qengineering/Install-OpenCV-Jetson-Nano/raw/main/OpenCV-4-5-5.sh
$ sudo chmod 755 ./OpenCV-4-5-5.sh
$ ./OpenCV-4-5-5.sh
$ pip install -r requirements.txt
detect.py: Detects vehicles present in each frame in a video and displays the results. (suitable for videos)
$ python detect.py --source data/vehicle_test_videos/live.mp4
count.py: Detects and counts the number of vehicles present in an images and displays the results. (suitable for images)
$ python count.py --source data/vehicle_test_images/
track.py: Detects, tracks and counts the number of vehicles as they cross through a virtual polygon area. (suitable for videos)
$ python track.py --source data/vehicle_test_videos/live.mp4