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.
- 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
- Language: Python
- Computer Vision: OpenCV
- Object Detection: YOLO
- Database: SQLite
- Configuration: Python environment/configuration files
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.
helmet-final/
│
├── inference.py
├── inference_enhanced.py
├── inference_video.py
├── database.py
├── config.py
├── requirements.txt
│
├── models/
│ └── ...
│
├── input/
│ └── ...
│
├── output/
│ └── ...
│
└── README.md
Clone the repository:
git clone https://github.com/dnspavankumar/helmet-final.git
cd helmet-finalInstall the required Python dependencies:
pip install -r requirements.txtMake sure the required YOLO model weights are available before running inference.
Run the image inference pipeline using the appropriate input image and model configuration.
python inference.pyThe system processes the image, performs helmet detection, and generates the corresponding detection output.
For video-based detection:
python inference_video.pyThe video pipeline processes the input video frame-by-frame and produces an annotated output video containing the detected helmet and no-helmet instances.
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.
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.
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
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
This project is intended for educational and experimental use.