Video-Based Vehicle Counting and Analysis using YOLOv5 and DeepSORT with Deployment on Jetson Nano



Vehicle Detection, Vehicle Tracking, Vehicle Counting, YOLOv5, Edge Deployment


In recent years, the advancements in deep learning and high-performance edge-computing systems have increased tremendously and have become the center of attention when it comes to the analysis of video-based systems on edge by making use of computer vision techniques. Intelligent Transportation Systems (ITS) is one area where deep learning can be used for several tasks including highway-based vehicle counting systems whereby making use of computer vision techniques, an edge computing device and cameras installed in specific locations on the road, we are able to obtain very accurate vehicle counting results and replace the use of traditional and laborious hardware devices with modern low-cost solutions. This paper proposes and implements a modern, compact, and reliable vehicle counting system based on the most recent and popular object detection algorithm as of writing this paper, known as the YOLOv5, combined with a state-of-the-art object tracking algorithm known as DeepSORT. The YOLOv5 will be used in the following system to detect and classify four different classes of vehicles, whereas DeepSORT will be used to track those vehicles across different frames in the video sequence. Finally, a unique and efficient vehicle counting method will be implemented and used to count tracked vehicles across the highway scenes. A new highway vehicle dataset consisting of four vehicle classes, namely: car, motorcycle, bus, and truck, was collected, cleaned, and annotated with a total of 11,982 images published in the following study and used for the training of our robust vehicle detection model. From the results obtained over real-world highway surveillance videos, the following system was able to obtain an average vehicle detection mAP score of 96.1% and a vehicle counting accuracy of 95.39%, all while being able to be deployed on a compact Nvidia Jetson Nano edge-computing device with an average speed of 15 FPS which outperforms other previously proposed tools in terms of both accuracy and speed.


Download data is not yet available.


Metrics Loading ...


H. Song and H. Liang, “Vision-based vehicle detection and counting system using deep learning in highway scenes,” vol. 4, 2019.

Z. Luo et al., “Details of the MIO-TCD dataset for vehicle MIO-TCD : A new benchmark classification and localization in press at IEEE Transactions on Image Classification challenge dataset Localization challenge dataset Click here to download the entire dataset :,” pp. 1–9, 2018.

G. Jocher et al., “ultralytics / yolov5 : v6 . 1 - TensorRT , TensorFlow Edge TPU and OpenVINO Export and Inference,” pp. 4–11, 2020.

P. R. Gunjal, B. R. Gunjal, H. A. Shinde, S. M. Vanam, and S. S. Aher, “Moving Object Tracking Using Kalman Filter,” 2018 Int. Conf. Adv. Commun. Comput. Technol. ICACCT 2018, pp. 544–547, 2018, doi: 10.1109/ICACCT.2018.8529402.

I. C. Vision, “Computer Vision for Multi-Object Tracking — Live Example,” pp. 1–17, 2019.

D.-L. Dinh, H.-N. Nguyen, T. Thai, and K.-H. Le, “Towards AI-Based Traffic Counting System with Edge Computing,” J. Adv. Transp., vol. 2021, pp. 1–15, 2021, doi: 10.1155/2021/5551976.

F. Herzog, X. Ji, T. Teepe, S. Hörmann, J. Gilg, and G. Rigoll, “Lightweight Multi-Branch Network for Person Re-Identification,” Proc. - Int. Conf. Image Process. ICIP, vol. 2021-Septe, pp. 1129–1133, 2021, doi: 10.1109/ICIP42928.2021.9506733.

NVidia Corporation, “Jetson NANO Module,” 2019, [Online]. Available:

M. A. Bin Zuraimi and F. H. Kamaru Zaman, “Vehicle detection and tracking using YOLO and DeepSORT,” ISCAIE 2021 - IEEE 11th Symp. Comput. Appl. Ind. Electron., pp. 23–29, 2021, doi: 10.1109/ISCAIE51753.2021.9431784.

M. Fachrie, “A Simple Vehicle Counting System Using Deep Learning with YOLOv3 Model,” J. RESTI (Rekayasa Sist. dan Teknol. Informasi), vol. 4, no. 3, pp. 462–468, 2020, doi: 10.29207/resti.v4i3.1871.




How to Cite

Mansour Mohamed, A. S. M. M., & Rashid, M. M. (2022). Video-Based Vehicle Counting and Analysis using YOLOv5 and DeepSORT with Deployment on Jetson Nano. Asian Journal of Electrical and Electronic Engineering, 2(2), 11–20. Retrieved from




Most read articles by the same author(s)