-
TrafficFlow is an open-source project developed by KGXperience designed for the automated vehicle surveillance of a given region.
-
The project consists of an object detection pipeline that tracks the entry and exit of vehicles by keeping track of their numberplate.
-
The object detection pipeline is built using YOLOv8 and the dashboard is built using Thingsboard server.
Follow these simple steps to get started with TrafficFlow:
- Clone the Repository:
git clone https://github.com/kgex/trafficflowyolov8
- Install Requirements:
pip install -r requirements.txt
- Download Sample Video
gdown https://drive.google.com/uc?id=1_Lsve_tfnv5weRMnYE93K1aANWyoRk8E
- Run the Code:
python scripts/main.py --input # 0 for webcam or path/to/video.mp4
YOLOv8, a state-of-the-art object detection model, is specifically trained for vehicle detection and numberplate detection respectively. Both models will run sequentially in the pipeline and the resultant image will be passed to PaddlePaddleOCR model for numberplate extraction.
- Vehicle Detection Model:
- The first YOLOv8 model is dedicated to detect the incoming vehicles within a given region.
- The trained model will predict these particular classes:
- Bike
- Car
- Bus
- Number Plate Detection Model:
- The second YOLOv8 model takes the cropped output of the detected vehicles and focuses on detecting the number plates from each vehicle.
The models were trained using indigenous dataset gathered by the incoming traffic of the KGiSL Campus.
Models | Train Loss | Validation loss | MaP | Precision | Recall |
---|---|---|---|---|---|
Vehicle Detection Model | 0.84073 | 1.0158 | 0.92726 | 0.88056 | 0.88054 |
Numbeplate Detection Model | 0.99308 | 1.1624 | 0.95279 | 0.95196 | 0.94387 |
Description | Link |
---|---|
Vehicle Detection | |
Number Plate Detection |