Skip to content

Somprat/Helmet-Detection-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Helmet Detection System ⛑️🏍️

A computer vision project that detects the helmet usage dof the mototrcycle riders during the traffic, using YOLOv8 and PyTorch

--

📌 Overview

This project implements a helmet detection system that can identify whether motorcycle riders wear their helmets or not in images and videos. The system uses deep learning object detection trained with a custom dataset and perform a realtime inference, using OpenCV.

The goal of this project is to explore the real life applications of machine learning and computer vision in the traffic safety and monitoring.

--

🧠 Features

  • The helmet and no helmet detection system
  • The YOLOv8-based object detection model
  • The custom dataset
  • Video Stream Processing with OpenCV

--

👜 Project Structure

HelmetProject/
├── dataset/
│   └── data.yaml
├── train.py
├── Test.py
├── CapturePic.py
├── runs/
├── weights/
├── .gitignore
└── README.md

🧪 Model Training

This model is trained using Ultralytics YOLOv8

from ultralytics import YOLO

model = YOLO(yolov8n.pt)

model.train(
    data="dataset/data.yaml",
    imgsz=640,
    epochs=80,
    batch=8,
    freeze=5
)

The t🚀ain results, including the evaluation metrics and weights, will be save under

runs/detect/train*/weights

⚠️Train Weights Notice

Due to the GitHub file size limitations, the train model weights (e.g. best.pt) are not included included in this respiratory.

To obtain the trained weights;

  1. run train.py locally
  2. best.pt will be generated under
runs/detect/train*/weights

To use your trained model for inference:

from ultralytics import YOLO
model = YOLO("path/to/best.pt")

🎥 Demo

A demo video can be recorded using:

  1. macOs screen recording system
  2. OBS Studio

🛠️ Technology Used

  • Python
  • Ultralytics YOLOv8
  • OpenCV
  • PyTorch
  • GitHub

🚀 Future Improvenets

  • improve dataset diversity for better generalization
  • Deploy a web application or API

Notes

This project was developped for the educational purpose to gain some hand on experience on the real world application of machine learning.

About

A computer vision system that detects motorcycle helmet violation from traffic camera footage, using the fine tuned YOLOv8 model.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages