Skip to content

This repository contains a Python script for object detection using YOLOv5. The script utilizes pre-trained YOLOv5 models of different sizes to detect objects such as cars, bicycles, buses, trucks, and motorbikes in images. Detected objects are highlighted with bounding boxes and labeled accordingly.

License

Notifications You must be signed in to change notification settings

kunalkushwahatg/yolov5

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

YOLOv5 Object Detection

This repository contains a Python script for performing object detection using the YOLOv5 model on images containing cars, bicycles, buses, trucks, and motorbikes. The detected objects are highlighted with bounding boxes and labeled accordingly.

Overview

The yolo.py script loads the pre-trained YOLOv5 model and performs object detection on images. It then displays the detection results using OpenCV.

Usage

  • Clone this repository: --git clone https://github.com/kunalkushwahatg/yolov5.git
  • --cd yolov5-object-detection
  • Download models from yolov5_models and place it in main folder.
  • Place your images containing objects you want to detect in the images directory.
  • Run the yolo.py script
  • This script also contains a function for detection that can be used for flask / fastapi / django based webapps.

Pre-trained Models

This repository includes pre-trained YOLOv5 models of different sizes:

  • YOLOv5s (Small)
  • YOLOv5m (Medium)
  • YOLOv5l (Large)
  • YOLOv5x (Extra Large)

You can switch between these models by modifying the model initialization line in the yolo.py script according to your requirements: model = Model('yolov5s.pt', device='cpu')

Requirements

  • Python 3.x
  • PyTorch
  • OpenCV
  • NumPy

Install the required dependencies using: pip install -r requirements.txt

Acknowledgments

  • YOLOv5: Ultralytics YOLOv5
  • COCO dataset: COCO

About

This repository contains a Python script for object detection using YOLOv5. The script utilizes pre-trained YOLOv5 models of different sizes to detect objects such as cars, bicycles, buses, trucks, and motorbikes in images. Detected objects are highlighted with bounding boxes and labeled accordingly.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages