Penerapan YOLO dan OpenCV dalam Klasifikasi Kendaraan pada Lalu Lintas Kota Depok
Abstract
The growth in the number of vehicles in Depok City has driven the need for an accurate and efficient traffic monitoring system. This study implements the You Only Look Once (YOLO) version 8 algorithm to automatically detect and classify vehicles based on Python and OpenCV. The focus of the study is on four types of vehicles, namely motorcycles, private cars, buses, and trucks. The dataset was obtained from CCTV recordings and field documentation, then annotated using LabelImg and processed into YOLO format. The training process was carried out using the pretrained YOLOv8 model, while the system testing was conducted on videos of Depok City roads. Model performance was evaluated using the metrics of mAP@0.5 and mAP@0.5:mAP95, precision, recall, and F1 score. The evaluation results show that the model achieved a mAP@0.5 of 91% and a mAP@0.5:mAP95 of 75.1%, precision of 88.5%, recall of 85.2%, and an F1-score of 86.8%. With these results, the model is capable of detecting and classifying vehicles in real time with high accuracy under various lighting conditions and camera angles. Additionally, this system is integrated with a web interface using Flask for direct visualization of detection results. This research contributes to supporting smart transportation systems in urban environments and provides a potential solution for data-based traffic management.
References
AI_Pioneer. (2023, June 28). Object detection with YOLO and OpenCV: A Practical Guide | by AI_Pioneer | Medium. https://medium.com/%40tejasdalvi927/object-detection-with-yolo-and-opencv-a-practical-guide-cf7773481d11
Badan Pusat Statistik (BPS). (2024). Jumlah Kendaraan Bermotor Menurut Kabupaten/Kota dan Jenis Kendaraan di Provinsi Jawa Barat (unit), 2023 - Tabel Statistik - Badan Pusat Statistik Provinsi Jawa Barat. https://jabar.bps.go.id/id/statistics-table/3/VjJ3NGRGa3dkRk5MTlU1bVNFOTVVbmQyVURSTVFUMDkjMw==/jumlah-kendaraan-bermotor-menurut-kabupaten-kota-dan-jenis-kendaraan-di-provinsi-jawa-barat--unit---2023.html?year=2023
berita.depok.go.id. (2023). Wali Kota Depok Pantau Lalu Lintas Kota Lewat 125 CCTV. Https://Berita.Depok.Go.Id/Wali-Kota-Depok-Pantau-Lalu-Lintas-Kota-Lewat-125-Cctv.
Chavan, C., Hembade, S., Jadhav, G., Komalwad, P., & Rawat, P. (2023). Computer vision Application Analysis based on Object detection. INTERANTIONAL JOURNAL OF SCIENTIFIC RESEARCH IN ENGINEERING AND MANAGEMENT, 07(04). https://doi.org/10.55041/ijsrem19015
Ciksadan, C., Soim, S., & Jami, N. (2024). Desain dan Pengembangan Website untuk Mendeteksi Malware Menggunakan Framework Flask yang Diintegrasikan dengan Machine learning. Jurnal Teknologi Sistem Informasi Dan Aplikasi, 7(3), 1213–1218. https://doi.org/10.32493/jtsi.v7i3.42003
Dr. Basuki Rahmat, S. S. M., & Budi Nugroho, S. K. M. K. (2021). Pemrograman Deep Learning dengan Python.
Dr. Budi Raharjo, S. Kom. , M. Kom. , MM. (2021). SISTEM MANAJEMEN DATABASE.
Dr.Arie Gunawan. (2024). Mobile Programming Menggunakan Flutter dan Visual Studio Code Untuk Pemula. www.penerbitlitnus.co.id
ella siman. (2023). What Is a Dataset? Definitive Guide. Https://Brightdata.Com/Blog/Web-Data/What-Is-a-Dataset. https://brightdata.com/blog/web-data/what-is-a-dataset
Gede, I., Sudipa, I., & Darmawiguna, M. (2024). BUKU AJAR DATA MINING. https://www.researchgate.net/publication/377415198
Hashmi, K. A., Pagani, A., Stricker, D., & Afzal, M. Z. (2022). BoxMask: Revisiting Bounding box Supervision for Video Object detection. http://arxiv.org/abs/2210.06008
Hussain, M. (2023). YOLO-v1 to YOLO-v8, the Rise of YOLO and Its Complementary Nature toward Digital Manufacturing and Industrial Defect Detection. In Machines (Vol. 11, Issue 7). Multidisciplinary Digital Publishing Institute (MDPI). https://doi.org/10.3390/machines11070677
Interaction Design Foundation. (2023). User Interface (UI) Design. https://www.interaction-design.org/literature/topics/ui-design
Joseph Teguh Santoso. (2023). KECERDASAN BUATAN.
labelImg. (n.d.). Https://Pypi.Org/Project/LabelImg/.
Lintang, H., Hafidz, F., Rafi, M., Naufal, A., & Muthalib, M. A. (2024). Penerapan AI untuk Optimasi Rute Secara Real time dan Meningkatkan Efisiensi Pengiriman. Jurnal Sains Masyarakat, 01. https://doi.org/10.1016/j.ijlm.2022.04.003
Malik, U. (2022). Image Processing in Open CV. International Journal for Research in Applied Science and Engineering Technology, 10(6), 2664–2666. https://doi.org/10.22214/ijraset.2022.44527
Marpaung, F., Aulia, F., Suryani SKom, N., & Cyra Nabila SKom, R. (2022). COMPUTER VISION DAN PENGOLAHAN CITRA DIGITAL. www.pustakaaksara.co.id
Melanie. (2023). What is a dataset? How do I work with it? Https://Datascientest.Com/En/What-Is-a-Dataset-How-Do-i-Work-with-It. https://datascientest.com/en/what-is-a-dataset-how-do-i-work-with-it
Mulyana, D. I., & Rofik, M. A. (2022). Implementasi Deteksi Real time Klasifikasi Jenis Kendaraan Di Indonesia Menggunakan Metode YOLOV5.
Muttaqin, Muhammad Munsarif, Green Ferry Mandias, Wahyu Wijaya Widiyanto, Stenly Richard Pungus, Agung Widarman, Suryani, Aslam Fatkhudin, Eva Firdayanti Bisono, Pasnur, Nurirwan Saputra, Siska Aprilia Hardiyanti, Mochammad Anshori, Eva Firdayanti Bisono, & Wiranti Kusuma Hapsari. (2024). Pengenalan Data Mining.
opencv. (n.d.). opencv. Https://Opencv.Org/About/.
Raharjo, B. (2021). Pembelajaran Mesin (Machine learning).
Ramadhani, F., Satria, A., & Dewi, S. (2024). Identifikasi Kendaraan Bermotor pada Dashcam Mobil Menggunakan Algoritma YOLO. Hello World Jurnal Ilmu Komputer, 2(4), 199–206. https://doi.org/10.56211/helloworld.v2i4.466
Sadik, N., Hossain, T., & Sayeed, F. (2024). Real time Detection and Analysis of Vehicles and Pedestrians using Deep Learning.
Saha, S. (2024). Traffic Monitoring System Using Machine learning And Python OpenCV and YOLOv8. https://doi.org/10.13140/RG.2.2.12182.46408
Soebroto, A. A. (2019). Buku Ajar AI, Machine learning & Deep Learning. https://www.researchgate.net/publication/348003841
Stuart J. Russel, & Peter Norvig. (2021). Artificial Intelligence A Modern Approach Fourth Edition.
Szeliski, R. (2021). Computer vision: Algorithms and Applications 2nd Edition. https://szeliski.org/Book,
Terven, J., Córdova-Esparza, D. M., & Romero-González, J. A. (2023). A Comprehensive Review of YOLO Architectures in Computer vision: From YOLOv1 to YOLOv8 and YOLO-NAS. In Machine learning and Knowledge Extraction (Vol. 5, Issue 4, pp. 1680–1716). Multidisciplinary Digital Publishing Institute (MDPI). https://doi.org/10.3390/make5040083
Ujjwal Sharma , Tanya Goel , Dr. Jagbeer Singh. (2023). Real time Image Processing Using Deep Learning With Opencv And Python. Journal of Pharmaceutical Negative Results, 1905–1908. https://doi.org/10.47750/pnr.2023.14.03.246
What is Python? Executive Summary | Python.org. (n.d.). Retrieved May 6, 2025, from https://www.python.org/doc/essays/blurb/
W3C. (2024). HTML Living standard. World Wide Web Consortium. Retrieved from https://html.spec.whatwg.org/multipage/
Mozilla Developer Network. (2023). CSS: Cascading Style Sheets. Mozilla Foundation. Retrieved from https://developer.mozilla.org/en-US/docs/Web/CSS
Mozilla Developer Network. (2024). JavaScript Guide. Mozilla Foundation. Retrieved from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide
Hui, J. (2019). mAP (Mean Average precision) for Object detection. Retrieved from https://jonathan-hui.medium.com/map-mean-average-precision-for-object-detection-45c121a31173
V7 Labs. (2023). What is Mean Average precision (mAP) and How it Works. Retrieved from https://www.v7labs.com/blog/mean-average-precision
Albon, C. (2020). Machine learning with Python for Everyone. Addison-Wesley Professional.
Jupyter Project. (2021). Teaching and Learning with Jupyter. Retrieved from https://jupyter4edu.github.io/jupyter-edu-book/
SuperAnnotate. (2024). Understanding mAP in Object detection. Retrieved from https://www.superannotate.com/blog/mean-average-precision-and-its-uses-in-object-detection
Pratama, B. A., Rahman, S., & Sembiring, A. (2023). Klasifikasi Jenis Kendaraan pada Jalan Raya Menggunakan YOLOv7. Jurnal Informatika Teknologi dan Sains (JINTEKS), 5(4). Model YOLOv7 berhasil melakukan klasifikasi jenis kendaraan seperti mobil, sepeda motor, bus, dan truk dengan akurasi mencapai 86% untuk video dan 91% untuk gambar.
Telaumbanua, A. P. H., Larosa, T. P., Pratama, P. D., Fauza, R. H., & Husein, A. M. (2023). Vehicle Detection and Identification Using Computer vision Technology with the Utilization of the YOLOv8 Deep Learning Method. Sinkron: Jurnal dan Penelitian Teknik Informatika, 7(4), 2150–2157. Penelitian ini menunjukkan kemampuan YOLOv8 dalam mendeteksi dan mengidentifikasi kendaraan secara akurat di Indonesia.
Copyright (c) 2026 Jurnal Teknologi Informasi (JUTECH)

This work is licensed under a Creative Commons Attribution 4.0 International License.







