Skip to content

The "Adaptive Traffic Manager" utilizes YOLO (You Only Look Once) for real-time vehicle detection to dynamically control traffic signals based on current traffic density, optimizing traffic flow and reducing congestion.

Notifications You must be signed in to change notification settings

Lalwaniamisha789/Adaptive-Traffic-Manager

Repository files navigation

Adaptive Traffic Manager

Overview

Adaptive Traffic Manager is a real-time traffic control system designed to optimize traffic light durations based on live traffic density at intersections. The system uses the YOLO object detection algorithm to detect vehicles in real-time, allowing for dynamic control of traffic signals, which reduces congestion and improves traffic flow.

Features

  • Real-time vehicle detection using YOLO.
  • Dynamic traffic light control based on traffic density.
  • Configurable green light durations based on detected vehicle counts.
  • Integration with traffic signal hardware (e.g., Raspberry Pi, GPIO control).

Problem Statement

Traditional traffic management systems operate on fixed timers or manual control, which often leads to inefficient traffic flow, increased waiting times, and higher fuel consumption. This project aims to solve these issues by utilizing real-time vehicle detection to adapt signal timings dynamically, resulting in:

  • Reduced waiting times.
  • Lower fuel consumption and pollution.
  • Decreased accident frequency by optimizing traffic flow.

Technology

  • YOLO: A powerful object detection model that uses a single forward pass of a convolutional neural network to detect vehicles in real-time. YOLO's efficiency makes it ideal for traffic management applications where real-time processing is essential.

Installation

  1. Clone the repository:
    git clone https://github.com/Lalwaniamisha789/Adaptive-Traffic-Manager.git
    cd AdaptiveTrafficManager
    
  2. Install dependencies
    pip install -r requirements.txt
    
  3. Ensure you have YOLO installed:
    git clone https://github.com/ultralytics/yolo.git
    cd yolo
    pip install -r requirements.txt
    

Usage

  1. Start the system with live video feed
    python main.py --source <path_to_video_or_camera_feed>
  2. Adjust the settings in configuration files.

How it works

  1. The camera feed captures videos from intersection
  2. YOLO detects vehicles in the video feed and counts the number of vehicles in each lane.
  3. I used the SORT model to ID vehicles crossing a threshold.
  4. Based on the traffic density, the traffic signal controller adjusts the green light duration for each lane dynamically, optimizing traffic flow and reducing congestion.

Sample Images

1. Detecting vehicles and pedestrians

Screenshot 2024-10-06 163736 Screenshot 2024-10-06 163810

2. IDing all vehicles(car, bus, truck, motorbikes) crosssing a threshold under a mask restricting the detection to required part of the lane

Screenshot 2024-10-07 001848

Algorithm Used

165362571-06875fea-9fe9-4075-a74e-871503363649

About

The "Adaptive Traffic Manager" utilizes YOLO (You Only Look Once) for real-time vehicle detection to dynamically control traffic signals based on current traffic density, optimizing traffic flow and reducing congestion.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published