/video-object-detection-cpp-yolov5-opencv

This project is a simple implementation of video object detection in c++ with OpenCV and YOLOv5.

Primary LanguageMakefile

YOLOv5 Object Detection with C++ and OpenCV

yolov5

Introduction

This is a project to demonstrate the use of YOLOv5 with cpp and opencv to detect objects in a given video input. YoloV5 is a powerful object detection model that can be used in various applications such as autonomous vehicles, security systems, and many more. This project uses the YOLOv5 model to detect objects in a video and display the output with bounding boxes around the detected objects.

Requirements

  • Python 3.8 and above
  • OpenCV 4.5.4 and above
  • CMake
  • YOLOv5 5.0
  • GCC 6.3.0

Installation

  1. Clone the repository
  2. Install OpenCV - follow the this link: https://docs.opencv.org/master/d7/d9f/tutorial_linux_install.html
  3. Install CMake - follow the this link: https://cmake.org/download/
  4. Install YOLOv5 - follow the this link: https://sourceforge.net/projects/yolov5.mirror/files/v7.0/yolov5m.onnx/download

Usage

Run the following commands:

mkdir build
cd build
cmake ..
make
./YOLOv5_Detector
  1. The output will be displayed in the data folder.

Testing

The code will convert the video input into frames and then detect objects in each frame. The output will be displayed with bounding boxes around the detected objects.

All the images output will be saved in the data folder.

Conclusion

The project demonstrates the use of YOLOv5 with cpp and opencv to detect objects in a given image input. The project can be further extended to detect objects in a video stream or a live feed from a camera.

References