Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

YOLOv5 Person Detection

This project implements automated person detection using the YOLOv5 object detection model. It processes a structured dataset of images, applies detection using a pre-trained YOLOv5 model, and saves the output images with bounding boxes.

Dataset Structure

The dataset should follow this folder structure:


dataset/
├── subfolder1/
│   └── images/
│       ├── image1.jpg
│       └── image2.jpg
├── subfolder2/
│   └── images/
│       ├── image3.jpg
│       └── image4.jpg

Technologies Used

  • Python 3.x
  • PyTorch
  • OpenCV
  • Matplotlib
  • YOLOv5 via Torch Hub

Usage Instructions

  1. Install the required packages:
pip install torch torchvision opencv-python matplotlib
  1. Place your dataset in the ./dataset folder.

  2. Run the script:

python detect_from_dataset.py
  1. Detected images with bounding boxes will be saved in the ./detections folder, organized by subfolder.

Optional: Detect Only People

To restrict detection to only persons (class 0 in the COCO dataset), modify the model as follows in the script:

model.classes = [0]

Output

The script saves the annotated images and optionally displays them using Matplotlib.

Screenshot

Screenshot (130)

About

This project implements a real-time person detection system using the YOLOv5 deep learning model. It leverages the power of YOLOv5 for fast and accurate detection of people in images or video streams, suitable for applications like surveillance, crowd monitoring, and smart security systems.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages