Coder Social home page Coder Social logo

huynt654 / traffic-state-detection Goto Github PK

View Code? Open in Web Editor NEW

This project forked from duongngockhanh/traffic-state-detection

0.0 0.0 0.0 628.81 MB

Using YOLOv5 and Image Processing for Detect Traffic State.

Shell 0.75% Python 75.92% Jupyter Notebook 22.92% Dockerfile 0.40%

traffic-state-detection's Introduction

Traffic State Detection

Object Detection

Dataset

  • It consists of 3,849 photos collected from various sources, from the Internet or from videos taken on highways and roads in Hanoi.
  • Various data enhancement techniques from Roboflow API and available augmentation methods of YOLO were used.
  • It includes 4 types of vehicles: car, bike, bus, truck. With the number of instances for each class as follows: 9,087 cars, 6,278 bikes, 1,138 buses, 3,976 trucks.
  • The dataset is divided according to the ratio: 70/20/10.
  • All images are processed in the standard size of 640x640 before being used for training.

Configuration

  • Three models were trained: YOLOv5n, YOLOv7, and YOLOv8n, using pre-trained models available in open-source, with a training of 100 epochs on the same dataset.
  • They were trained on Google Colab with a GPU configuration of Tesla K80 and 12GB of RAM.
  • They were tested on a MacBook Pro 2015 with an Intel Core i5 Dual Core CPU and 16GB of RAM.

Result

Model params (M) FLOPs (B) Size Speed (ms) mAP@50 mAP@50-95
YOLOv5n 1.9 4.5 640 104.6 96.2% 67.5%
YOLOv8n 3.2 8.7 640 178.3 96.8% 70.9%

Congestion Classification

Algorithm

  • In this problem, traffic congestion classification is determined through the calculation of the ratio x between the total area of bounding boxes surrounding the detected vehicles (V) and the area of the region of interest (R), assuming that each pixel is a unit of area.
  • The region of interest is the area where the detection and counting of vehicles will be performed. It is drawn immediately after running the program.
  • Below is the area of the region of interest, R.

image

- Below is the total area of the bounding boxes, V.

image

The ratio V/R is then mapped to a balanced scale and passed through a sigmoid function to distinguish more clearly between two states: congestion and normal.

Result

The result indicates a normal traffic state.

image

The result indicates a traffic congestion state.

image

traffic-state-detection's People

Contributors

duongngockhanh avatar

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.