Skip to content

This is a simple example of how to use the YOLO V3 algorithm to detect objects within your class file.

Notifications You must be signed in to change notification settings

IvanFernande/YOLO-V3-simple-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Object Detection with YOLO and OpenCV

This is a project for object detection using the YOLO (You Only Look Once) model and the OpenCV library. The detector identifies objects in an image and draws bounding boxes around them, along with class labels and confidence scores.

Requirements

  • Python 3.x
  • OpenCV 4.5.3.56
  • YOLO model files (yolov3.cfg, yolov3.weights)
  • Class names file (coco.names)
  • An input image with a perspective similar to the human eye

Installation

In order to get the weights for the algorithm, click on this drive link: https://drive.google.com/drive/u/1/folders/1QuR4pli3nyPK-cK6GsfhSq2tLd4ydvLW

  1. Clone or download this repository to your local machine.

  2. Ensure you have the correct version of OpenCV (4.5.3.56) installed. You can install it using pip:

   pip install opencv-python==4.5.3.56
  1. Place the YOLO model files (yolov3.cfg and yolov3.weights) in the project directory.

  2. Place the class names file (coco.names) in the project directory.

  3. Make sure you have an input image with a perspective similar to the human eye. Rename it to yolo_prueba.png and place it in the project directory.

Usage

Run the main.py script to execute the object detector on the input image. Detected objects will be highlighted with bounding boxes and class labels, and the resulting image will be saved as output_image.jpg.

Adjust the confidence threshold by modifying the confidence_threshold variable in the main.py script to suit your needs.

confidence_threshold = 0.5  # Set your desired confidence threshold

Example

Below is an example of the output from the YOLO and OpenCV object detection:

Sample Output

In the sample image, detected objects are highlighted with bounding boxes and class labels, along with their respective confidences.

About

This is a simple example of how to use the YOLO V3 algorithm to detect objects within your class file.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages