Thanks to visit codestin.com
Credit goes to github.com

Skip to content

TrH203/Traffic-violation-detection

Repository files navigation

Traffic Violation Detection

Development Status Version Dependencies Contributors Python Version

Overview

This scientific research project, conducted at Duy Tan University (DTU), aims to develop a robust system for detecting traffic violations using YOLOv5 models in conjunction with OpenCV.

Project Screenshot

Youtube Demo

Link: https://youtu.be/ddhAg65acd0

Project Structure

Models Used

The project leverages three distinct YOLOv5 models to address different components of traffic violation detection:

  • Vehicle Detection: Identifies vehicles on the road.
  • Helmet Detection: Identifies helmet on the road.
  • Plate Detection: Extracts the license plate from the detected vehicle.
  • Number Plate Detection: Extracts the numeric characters from the license plate.

How It Works

The detection pipeline involves the following steps:

  1. Vehicle Detection: Locating the vehicle on the road.
  2. Helmet Detection: (If applicable) Identifying whether the rider is wearing a helmet.
  3. License Plate Detection: Isolating the vehicle’s license plate.
  4. Number Extraction: Extracting numeric values from the license plate.

Pre-processing

Given that real-world images often lack the clarity of training images, pre-processing is crucial. We apply a blurring technique to improve the performance of the Number Plate Detection model.

  • Before Pre-processing:

    Pre-processing

  • After Pre-processing:

    Pre-processing2

Training

Model training is performed on Kaggle using YOLOv5. More details can be found in the Kaggle Notebook.

For a deeper dive into YOLOv5, refer to the official documentation.

Results

A pipeline integrates the three models, where each model's output serves as the input for the next.

  1. Vehicle Detection:

    • Input: Images, Mask, Separation Line (for Lane Encroachment Detection).
    • Output: Images highlighting the detected violations.

    Vehicle Detection

  2. Plate Detection:

    • Output: Cropped images containing the vehicle's license plate.

    Plate Detection

  3. Number Plate Detection:

    • Output: Extracted numeric values, e.g., 59N12345, 76E152202, ...

Data

You can view and explore the dataset used in this project on Kaggle.

Pre-trained Weights

Pre-trained weights for the helmet detection model can be downloaded here.

About

Scientific research project at Duy Tan University (DTU)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •