Skip to content

YashrajKupekar17/Syook_person_and_ppe_detection

Repository files navigation

PPE Detection Using YOLOv8

Project Overview

This project implements a object detection system using YOLOv8 to identify persons and personal protective equipment (PPE) in various environments. The dataset consists of images and annotations for classes such as hard hats, gloves, masks, glasses, boots, vests, PPE suits, ear protectors, and safety harnesses. The goal is to train two models: one for detecting persons in whole images and another for detecting PPE in cropped images of persons.

Table of Contents

Installation

Prerequisites

  • Python 3.8 or higher
  • Git
  • Virtual environment (recommended)

Step 1: Clone the Repository

git clone https://github.com/YashrajKupekar17/Syook_person_and_ppe_detection
cd Syook_person_and_ppe_detection

Step 2: Set Up a Virtual Environment

python -m venv venv
source venv/bin/activate  # On Windows use venv\Scripts\activate

Step 3: Install Required Packages

pip install -r requirements.txt

Usage

Step 1: Prepare the Dataset

Download the dataset from the provided link. Extract the contents of Datasets.zip, which contains the images and annotations directories along with classes.txt.

Step 2: Convert Annotations

Run the following command to convert annotations from PascalVOC format to YOLOv8 format:

python pascalVOC_to_yolo.py --voc_dir path/to/annotations --yolo_dir path/to/yolov8_annotations

Step 3: Train the Models

Train Person Detection Model

To train the YOLOv8 model for person detection, run:

python train.py --data data.yaml --weights yolov8.pt --cfg yolov8.yaml --epochs 50

Train PPE Detection Model

To train the YOLOv8 model for PPE detection on cropped images, ensure you have implemented the logic to crop images based on the detected persons. Then run:

python train.py --data ppe_data.yaml --weights yolov8.pt --cfg yolov8.yaml --epochs 50

Step 4: Run Inference

To perform inference using both models, run:

python inference.py --input_dir path/to/images --output_dir path/to/output --person_det_model path/to/person_weights.pt --ppe_detection_model path/to/ppe_weights.pt

Evaluation Metrics

The models will be evaluated using metrics such as:

Precision

Recall

F1 Score

Mean Average Precision (mAP)

Report

A report containing the approaches, learning outcomes, and evaluation metrics is provided in PDF format. It includes:

Logic used for model training.

Challenges faced and solutions implemented.

Demonstration Video Project Report

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages