Skip to content

aashwika25/PPE_Detection_YOLO

Repository files navigation

PPE Detection using YOLO


A real-time Personal Protective Equipment (PPE) detection system built with YOLOv5, Flask, and OpenCV. This system identifies and classifies safety gear violations in industrial environments — helping ensure workplace safety by detecting:

  • ✅ Hardhat / ❌ No Hardhat
  • ✅ Mask / ❌ No Mask
  • ✅ Safety Vest / ❌ No Safety Vest
  • 👷 Person
  • 🚧 Safety Cone
  • 🏗 Machinery
  • 🚗 Vehicle

🎯 Project Goal

To build a lightweight, scalable, and accurate object detection system that can help organizations monitor employee safety compliance on-site using video/image input.


🧠 What It Detects

  • Hardhat, NO-Hardhat
  • Mask, NO-Mask
  • Safety Vest, NO-Safety Vest
  • Person, Safety Cone, Machinery, Vehicle

📂 Dataset

  • Source: Roboflow PPE Detection Dataset
  • Classes: 10 (as listed above)
  • Training: 2600 images
  • Validation: 114 images
  • Test: 82 images
  • Input Dimension: 640 × 640 px

🧰 Tech Stack

  • Model: YOLOv5 (Ultralytics)
  • Frameworks: OpenCV, Flask
  • Languages: Python
  • Environment: Jupyter, Localhost
  • Hardware: Intel i7 CPU, GPU optional (CUDA supported)
  • Libraries: PyTorch, NumPy, Matplotlib
  • Git LFS (for large model files)

🚀 Installation & Setup

  1. Clone the repository
git clone https://github.com/aashwika25/PPE_Detection_YOLO.git
cd PPE_Detection_YOLO
  1. Create a Conda environment (or use virtualenv)
conda create -n myyolo python=3.10 -y
conda activate myyolo
  1. Install requirements
pip install -r requirements.txt
  1. Run the application
python app.py
  1. Open in your browser:
Go to http://localhost:5000

Results :

1

3


✅ Features

  • Upload image or video for real-time PPE detection
  • Live webcam stream with safety gear classification
  • Fast and accurate inference using YOLOv5
  • Web interface built using Flask
  • Tracks compliance for hardhats, masks, and vests
  • Supports detection of multiple people and objects simultaneously
  • Lightweight and easy to deploy locally

📈 Performance Benchmarks

Mode FPS (YOLOv5s) FPS (YOLOv5m) Observations
Image 35+ 25+ Fastest mode
Video 18–25 12–18 CPU bottleneck for heavier models
Webcam ~20 ~14 Stable for real-time detection

🔮 Future Improvements

  • Integrate IP camera for remote/real-time surveillance
  • Add automatic alerts (email/SMS/buzzer) for violations
  • Export detection logs and statistics (CSV/JSON format)
  • Deploy on edge devices like NVIDIA Jetson or Raspberry Pi
  • Dockerize the app for portable deployment
  • Enable multilingual interface and accessibility features

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors