This project implements a Personal Protective Equipment (PPE) detection model using YOLOv8, deployed with Flask on DigitalOcean.
The PPE detection system consists of two main components:
- A person detection model trained on full images
- A PPE detection model trained on cropped person images
The system processes images through both models to identify persons and their PPE equipment.
The dataset used for training contains images and annotations for the following classes:
- Person
- Hard-hat
- Gloves
- Mask
- Glasses
- Boots
- Vest
- PPE-suit
- Ear-protector
- Safety-harness
/
/
├── .do/
│ └── app.yaml
├── app/
│ ├── static/
│ │ ├── css/
│ │ │ └── animated_background.css
│ │ └── images/
│ │ └── PPE_Detection.jpeg
│ ├── templates/
│ │ ├── base.html
│ │ ├── index.html
│ │ └── result.html
│ ├── __init__.py
│ └── views.py
├── scripts/
│ ├── inference.py
│ └── s3_cleanup.py
├── weights/
│ ├── person_detection/
│ │ └── best.pt
│ └── ppe_detection/
│ └── best.pt
├── requirements.txt
└── run.py
└── setup_ffmpeg.py
└── Procfile
└── Aptfile
└── LICENSE
-
Clone the repository:
git clone https://github.com/your-username/ppe-detection.git cd ppe-detection
-
Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install the required packages:
pip install -r requirements.txt
This project is deployed on DigitalOcean using Flask. The app.py
file contains the Flask application that serves the model predictions.
To run the Flask app locally:
python run.py
For production deployment, consider using Gunicorn as the WSGI HTTP server:
gunicorn run:app
Refer to the project report for detailed information on:
- Model architecture choices
- Training approaches
- Evaluation metrics
- Performance optimizations
- Implement real-time video processing
- Add a web interface for easy image upload and visualization
- Expand the model to detect additional PPE classes
Contributions to improve the project are welcome. Please follow these steps:
- Fork the repository
- Create a new branch (
git checkout -b feature/your-feature-name
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin feature/your-feature-name
) - Create a new Pull Request
This project is licensed under the Personal License. See the LICENSE file for details.
For any queries or support, please open an issue in the GitHub repository.