This project detects Personal Protective Equipment (PPE) in videos using a YOLO model and OpenCV.
Download the dataset from the above link and prepare your training data as needed.
- Python 3.8+
- ultralytics
- opencv-python
- cvzone
- numpy
Install dependencies with:
pip install ultralytics opencv-python cvzone numpy- Download and extract the dataset from the Kaggle link above.
- Place your video file in the
video/directory (e.g.,video/ppe-3-1.mp4). - Make sure your trained YOLO model weights are in the correct path (e.g.,
runs/detect/train2/weights/best.pt). - Edit
PPE.pyif you want to change the video or model path. - Run the detection script:
python PPE.py- The script will display the video with bounding boxes and labels for detected PPE items.
- Press
qto quit the video window.
- If you see errors about missing modules, please make sure you have activated the correct Python environment and installed all requirements.
- If you see errors about missing files, check that the video and model paths in
PPE.pyare correct.
PPE detection/
├── PPE.py
├── video/
│ └── ppe-3-1.mp4
├── runs/
│ └── detect/
│ └── train2/
│ └── weights/
│ └── best.pt
├── README.md