Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Helmet Detection System

A computer vision system for detecting helmet compliance from images and videos using YOLO-based object detection. The system performs inference, records detection results in SQLite, and provides separate tracking of helmet and no-helmet detections.

Features

  • YOLO-based helmet detection
  • Image inference
  • Video inference
  • Detection result tracking
  • SQLite database integration
  • Helmet / no-helmet classification
  • Automated result image and video generation
  • Configurable inference settings
  • Webhook configuration for integrating detection events with external services

Tech Stack

  • Language: Python
  • Computer Vision: OpenCV
  • Object Detection: YOLO
  • Database: SQLite
  • Configuration: Python environment/configuration files

How It Works

The system processes an input image or video and passes it through the trained YOLO detection model.

Input Image / Video
        │
        ▼
   YOLO Inference
        │
        ▼
Detection Results
        │
   ┌────┴─────┐
   ▼          ▼
Helmet     No Helmet
   │          │
   └────┬─────┘
        ▼
 Detection Logging
        │
        ▼
      SQLite

For video input, frames are processed sequentially and the detected objects are rendered onto the resulting video.

Project Structure

helmet-final/
│
├── inference.py
├── inference_enhanced.py
├── inference_video.py
├── database.py
├── config.py
├── requirements.txt
│
├── models/
│   └── ...
│
├── input/
│   └── ...
│
├── output/
│   └── ...
│
└── README.md

Installation

Clone the repository:

git clone https://github.com/dnspavankumar/helmet-final.git
cd helmet-final

Install the required Python dependencies:

pip install -r requirements.txt

Make sure the required YOLO model weights are available before running inference.

Image Inference

Run the image inference pipeline using the appropriate input image and model configuration.

python inference.py

The system processes the image, performs helmet detection, and generates the corresponding detection output.

Video Inference

For video-based detection:

python inference_video.py

The video pipeline processes the input video frame-by-frame and produces an annotated output video containing the detected helmet and no-helmet instances.

Detection Logging

Detection information can be stored using the project's SQLite database layer.

The database component provides persistent tracking of detection events, allowing results to be queried and analyzed after inference.

Configuration

Runtime settings such as model paths, input/output locations, and webhook-related configuration can be adjusted through the project's configuration files.

Keep environment-specific values outside the source code when deploying the system.

Applications

The system can be used as a foundation for:

  • Industrial safety monitoring
  • Construction-site safety systems
  • Roadside helmet compliance monitoring
  • CCTV-based safety analysis
  • Automated PPE detection systems

Future Improvements

Potential extensions include:

  • Real-time CCTV stream processing
  • Multi-camera monitoring
  • Improved detection accuracy
  • Web-based monitoring dashboard
  • Cloud-based detection storage
  • Real-time alert notifications
  • Detection analytics and reporting

License

This project is intended for educational and experimental use.

About

Computer vision system for real-time helmet compliance detection using YOLO, OpenCV, video inference, and SQLite-based detection tracking.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages