PPE Detection is a Python-based project that employs YOLOv8, a robust object detection model, to identify and classify personal protective equipment (PPE) on construction sites. The project involves downloading a YOLOv8 model from Roboflow, training it on Google Colab, and using the best.pt model to detect PPE in images or videos.
-
Python 3.6 or higher
-
Virtualenv (optional but recommended)
- Create a virtual environment and activate it:
virtualenv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install required packages:
pip install -r requirements.txt
- Download YOLOv8 model from Roboflow:
- Download the YOLOv8 model file from Roboflow and place it in the weights/ directory.
- Train the model on Google Colab:
- Follow the steps outlined in the colab file (Yolov8.ipynb) to train the model using your custom dataset.
- Prepare your video:
- Place your video file in the project directory.
- Run the PPE Detection:
python PPE-Detection.py
- View the results:
- The processed video with PPE Detections will identifies and labels present equipment (e.g., "mask") and denotes absence as "no-mask" for each equipment type, providing accurate results.
- You can customize the confidence threshold for PPE detection by modifying the conf parameter in PPE-Detection.py. The default value is set to 0.5.
Contributions are always welcome!
If you find any issues or have suggestions for improvements, feel free to create a pull request.
For any questions or inquiries, please contact us at [email protected].