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
To build a lightweight, scalable, and accurate object detection system that can help organizations monitor employee safety compliance on-site using video/image input.
Hardhat,NO-HardhatMask,NO-MaskSafety Vest,NO-Safety VestPerson,Safety Cone,Machinery,Vehicle
- Source: Roboflow PPE Detection Dataset
- Classes: 10 (as listed above)
- Training: 2600 images
- Validation: 114 images
- Test: 82 images
- Input Dimension: 640 × 640 px
- 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)
- Clone the repository
git clone https://github.com/aashwika25/PPE_Detection_YOLO.git
cd PPE_Detection_YOLO- Create a Conda environment (or use virtualenv)
conda create -n myyolo python=3.10 -y
conda activate myyolo- Install requirements
pip install -r requirements.txt- Run the application
python app.py- Open in your browser:
Go to http://localhost:5000- 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
| 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 |
- 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