In the field of construction and heavy industry, safety is of paramount importance. One of the key safety measures is the use of safety helmets. However, monitoring whether every worker is wearing a safety helmet can be a challenging task.
This project aims to automate the process of safety helmet detection by leveraging the power of deep learning. We use two state-of-the-art object detection models, YOLOv8 (You Only Look Once version 8) and Faster R-CNN (Region Convolutional Neural Networks). These models have been trained to detect and classify whether a person in an image or video stream is wearing a safety helmet or not.
The use of these models allows for real-time detection and classification, making it a viable solution for integration into existing surveillance systems. This could greatly enhance safety measures in the workplace, potentially preventing accidents and saving lives.
Before you begin, ensure you have met the following requirements:
- You have installed the latest version of Python (Python 3.7 or higher is recommended).
- You have a Windows/Linux/Mac machine with a decent GPU. This is because both YOLOv8 and Faster R-CNN are computationally intensive models.
- You have installed the necessary Python libraries and frameworks, including but not limited to PyTorch, torchvision, OpenCV, NumPy, and Matplotlib. You can install these using pip:
-
Install Python: The project is implemented using Python. If you don't have Python installed, you can download it from the official website: https://www.python.org/downloads/. We recommend using Python 3.7 or higher.
-
Install PyTorch: This project uses PyTorch as the deep learning framework. You can install it by following the instructions on the official PyTorch website: https://pytorch.org/get-started/locally/.
-
Clone the Project Repository: Use git to clone the project repository to your local machine. Open your terminal and run:
-
Navigate to the Project Directory: Change your current directory to the project directory:
cd Safety-Helmet-Detection-using-YOLOv8-and-Faster-R-CNN
-
Install Required Libraries: Install the necessary Python libraries and frameworks using pip:
pip install torchvision opencv-python numpy matplotlib
-
Download Pre-trained Models: Download the pre-trained YOLOv8 and Faster R-CNN models and place them in the
models/
directory. -
Run the Project: Finally, you can run the project.
The Safety Helmet Detection system using YOLOv8 and Faster R-CNN can be used in a variety of scenarios, primarily in industries where safety helmets are mandatory. Here are a few examples:
-
Construction Sites: The system can be integrated with existing CCTV cameras to monitor whether all workers on site are wearing safety helmets.
-
Factories and Industrial Areas: Similar to construction sites, the system can ensure that all factory workers are adhering to safety protocols.
-
Mining and Excavation Sites: In these high-risk areas, the system can provide an additional layer of safety by continuously monitoring workers.
-
Safety Training and Compliance: The system can be used in training scenarios to automatically evaluate whether trainees are following safety protocols.
-
Research and Development: The project can also be used as a base for further research in the field of object detection and industrial safety.
Remember, the goal of this project is to enhance workplace safety by ensuring the use of safety helmets, potentially preventing accidents and saving lives.
https://github.com/iSparshP/Safety-Helmet-Detection-using-YOLOv8-and-Faster-R-CNN/assets/77487266/bb49ab72-8b20-4fa5-8c1a-5d0771dbed44
This project is open for use by anyone. You are free to clone, modify, and distribute this project as you see fit. Please note that this project comes with no warranty.
For more details, please refer to the LICENSE file in the project repository.
I would like to express my gratitude to the following individuals and institutions:
- Priyam Dalmia - for their invaluable guidance and support throughout the project.
I would also like to acknowledge the creators and the community of the open-source libraries and frameworks used in this project, including PyTorch, OpenCV, and the YOLOv8 and Faster R-CNN models. Their work has made this project possible.