Git Product home page Git Product logo

sime-lab / adaptive-traffic-signal-timer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mihir-m-gandhi/adaptive-traffic-signal-timer

0.0 0.0 0.0 77.97 MB

This Adaptive Traffic Signal Timer uses live images from the cameras at traffic junctions for real-time traffic density calculation using YOLO object detection and sets the signal timers accordingly.

License: Apache License 2.0

Python 100.00%

adaptive-traffic-signal-timer's Introduction

Traffic Signal Timer

Adaptive Traffic Signal Timer

Python version License: Apache 2

This Adaptive Traffic Signal Timer uses live images from the cameras at traffic junctions for traffic density calculation using YOLO object detection and sets the signal timers accordingly, thus reducing the traffic congestion on roads, providing faster transit to people, and reducing fuel consumption.


Inspiration

  • Traffic congestion is becoming one of the critical issues with the increasing population and automobiles in cities. Traffic jams not only cause extra delay and stress for the drivers but also increase fuel consumption and air pollution.

  • According to the TomTom Traffic Index, 3 of the top 10 countries facing the most traffic congestion are in India viz. Mumbai, Bengaluru, and New Delhi. People are compelled to spend hours stuck in traffic jams, wasting away their precious time commuting. Current traffic light controllers use a fixed timer and do not adapt according to the real-time traffic on the road.

  • In an attempt to reduce traffic congestion, we developed an improved traffic management system in the form of a Computer Vision-based traffic light controller that can autonomously adapt to the traffic situation at the traffic signal. The proposed system sets the green signal time adaptively according to the traffic density at the signal and ensures that the direction with more traffic is allotted a green signal for a longer duration of time as compared to the direction with lesser traffic.


Implementation Details

This project can be broken down into 3 modules:

  1. Vehicle Detection Module - This module is responsible for detecting the number of vehicles in the image received as input from the camera. More specifically, it will provide as output the number of vehicles of each vehicle class such as car, bike, bus, truck, and rickshaw.

  2. Signal Switching Algorithm - This algorithm updates the red, green, and yellow times of all signals. These timers are set bases on the count of vehicles of each class received from the vehicle detection module and several other factors such as the number of lanes, average speed of each class of vehicle, etc.

  3. Simulation Module - A simulation is developed from scratch using Pygame library to simulate traffic signals and vehicles moving across a traffic intersection.

Read more about object detection model used, working of the algorithm, and development of simulation here.


Demo

  • Vehicle Detection

Vehicle Detection


  • Signal Switching Algorithm and Simulation


Prerequisites

  1. Python 3.7
  2. Microsoft Visual C++ build tools (For Windows only)

Installation

  • Step I: Clone the Repository
      $ git clone https://github.com/mihir-m-gandhi/Adaptive-Traffic-Signal-Timer
  • Step II: Download the weights file from here and place it in the Adaptive-Traffic-Signal-Timer/Code/YOLO/darkflow/bin directory

  • Step III: Install the required packages

      # On the terminal, move into Adaptive-Traffic-Signal-Timer/Code/YOLO/darkflow directory
      $ cd Adaptive-Traffic-Signal-Timer/Code/YOLO/darkflow
      $ pip install -r requirements.txt
      $ python setup.py build_ext --inplace
  • Step IV: Run the code
      # To run vehicle detection
      $ python vehicle_detection.py
      
      # To run simulation
      $ python simulation.py

Dissemination

  • This project was showcased at a national level project competition organized by Government Polytechnic Mumbai. View our presentation video here.

  • Our paper based on this project was presented at 5th IEEE International Conference on Recent Advances and Innovations in Engineering - ICRAIE 2020 and published in IEEE Xplore. View the paper here.


Contributors

Mihir Gandhi - mihir-m-gandhi

Devansh Solanki - devanshslnk

Rutwij Daptardar - RDmaverick


Acknowledgement

We would like to extend our sincere thanks to our mentor Mrs. Nirmala Shinde Baloorkar for her kind help and valuable advice. Her support and constant supervision were imperative for the successful completion of this project. We would also like to express our special gratitude and thanks to Mrs. Kavita Kelkar, the subject-matter expert for this project, for her valuable inputs and guidance.


License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.