traffic-congestion-
Science Score: 44.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (11.7%) to scientific vocabulary
Repository
Basic Info
- Host: GitHub
- Owner: Asmi-va
- License: agpl-3.0
- Language: Python
- Default Branch: main
- Size: 88.6 MB
Statistics
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
YOLOv5 Traffic Jam Detection
Introduction
This is a project on the YOLOv5-based traffic congestion detection system using object detection on images, videos, and real-time cameras. It involves the detection of vehicles from the images and identification of the traffic congestion based on their speed and density.
Motivation
Among several issues in urban centers, traffic congestion massively affects travel time and fuel consumption. If the traffic jam is detected efficiently and in real-time, it can help in effective traffic management and route planning. In this project, a robust system for detecting traffic jams is developed using the deep learning model YOLOv5.
Data Source
It uses a dataset of different images and videos of the traffic scenario to train the YOLOv5 model. Further, more annotations regarding the vehicle's position and class were prepared manually to improve this model's performance.
The link to download dataset for training Yolov5: - https://universe.roboflow.com/v9/car-models-ismtj/browse?queryText=&pageSize=50&startingIndex=0&browseQuery=true - This dataset have 3 objects: Car, Truck and Motorcycle
File Descriptions
modified_detect.py: Script for running the YOLOv5 detection inference.train.py: Script for training the YOLOv5 model on the custom dataset.utils/: Directory containing utility scripts for data loading, plotting, and other functions.data/: Directory containing the dataset and annotations.models/: Directory containing the YOLOv5 model definitions and configurations.
How to Use the Code
Usage
Clone the Repository:
- git clone https://github.com/yourusername/yolov5-traffic-jam-detection.git
- cd yolov5-traffic-jam-detection
- git clone https://github.com/yourusername/yolov5-traffic-jam-detection.git
Install Requirements::
- pip install -r requirements.txt
Run Detection on an Image:
- python modifieddetect.py --weights runs/train/exp/weights/best.pt --source data/images/yourimage.jpg
Run Detection on a Video:
- python modifieddetect.py --weights runs/train/exp/weights/best.pt --source data/videos/yourvideo.mp4
Run Detection on Live Camera Feed:
- python modified_detect.py --weights runs/train/exp/weights/best.pt --source 0
Testing Model
Video Predictions

Nornmal Traffic detect demo

Traffic congestion detect demo
-TensorBoard Training Visualizations after 50 epochs-

Precision and Recall after training

F1 and confusion matrix after training
final result
Results
The YOLOv5 model effectively detects traffic jams by identifying and tracking vehicle speeds and densities. The system alerts when a potential traffic jam is detected based on predefined thresholds for vehicle count and speed.
Requirements
To run this project, you will need the following libraries:
| Libraries |
|------------------------ |
| Pytorch |
| sys |
| platform |
| argparse |
| csv |
| pathlib |
| numpy |
| os |
Owner
- Name: asmi
- Login: Asmi-va
- Kind: user
- Repositories: 1
- Profile: https://github.com/Asmi-va
Citation (CITATION.cff)
cff-version: 1.2.0
preferred-citation:
type: software
message: If you use YOLOv5, please cite it as below.
authors:
- family-names: Jocher
given-names: Glenn
orcid: "https://orcid.org/0000-0001-5950-6979"
title: "YOLOv5 by Ultralytics"
version: 7.0
doi: 10.5281/zenodo.3908559
date-released: 2020-5-29
license: AGPL-3.0
url: "https://github.com/ultralytics/yolov5"
GitHub Events
Total
- Push event: 5
- Create event: 2
Last Year
- Push event: 5
- Create event: 2
Dependencies
- matplotlib >=3.3.0
- numpy >=1.22.2
- opencv-python >=4.6.0
- pandas >=1.1.4
- pillow >=7.1.2
- psutil *
- py-cpuinfo *
- pyyaml >=5.3.1
- requests >=2.23.0
- scipy >=1.4.1
- seaborn >=0.11.0
- thop >=0.1.1
- torch >=1.8.0
- torchvision >=0.9.0
- tqdm >=4.64.0
- ultralytics >=8.1.47
- PyYAML >=5.3.1
- gitpython >=3.1.30
- matplotlib >=3.3
- numpy >=1.23.5
- opencv-python >=4.1.1
- pandas >=1.1.4
- pillow >=10.3.0
- psutil *
- requests >=2.32.0
- scipy >=1.4.1
- seaborn >=0.11.0
- setuptools >=70.0.0
- thop >=0.1.1
- torchvision >=0.9.0
- tqdm >=4.64.0