This project involves training YOLOv8 models to detect persons and Personal Protective Equipment (PPE) in images. The project includes format conversion, model training, and inference.
- Person Detection Model: A YOLOv8 model trained to detect persons in images.
- PPE Detection Model: A YOLOv8 model trained on cropped images of detected persons to identify various PPE items (e.g., hard-hats, gloves, boots).
Convert PascalVOC annotations to YOLOv8 format:
python pascalVOC_to_yolo.py /path/to/pascalVOC_labels /path/to/output_dir
Note : The directory containing .xml files should have exact name 'pascalVOC_labels'
Train the person detection and PPE detection models using YOLOv8. Use the provided training scripts and datasets.
Run inference on a directory of images:
python inference.py --input_dir /path/to/input/images --output_dir /path/to/output/images --person_det_model /path/to/person/model --ppe_detection_model /path/to/ppe/model
Install the necessary packages using:
pip install -r requirements.txt
- pascalVOC_to_yolo.py: Script for converting PascalVOC annotations to YOLOv8 format.
- inference.py: Script for running inference with both person and PPE detection models.
- requirements.txt: List of required Python packages.