mehmet-karagoz / Object-Tracking-in-Video

This project is an example of object tracking in video using opencv and YOLO

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Object Tracking in Video

Python 3.6 OpenCV 4.5 YOLOv4 License: MIT

This repository contains scripts for object tracking in video using OpenCV's built-in trackers and the YOLOv4 object detection model.

Files

  • coco.names: This file contains the names of the 80 object classes that the YOLOv4 model can detect.
  • main.py: This script uses OpenCV's built-in KCF tracker to track an object in a video.
  • requirements.txt: This file lists all the Python dependencies that you need to run the scripts.
  • second.py: This script uses the YOLOv4 object detection model to detect objects in a video and then uses OpenCV's built-in CSRT tracker to track one of the detected objects.
  • test.mp4: This is the video in which you want to track objects.
  • yolov4.cfg: This is the configuration file for the YOLOv4 model.

Usage

  1. Install the required Python dependencies:
pip install -r requirements.txt
  1. Run the main.py script to track an object using the KCF tracker:
python main.py
  1. Run the second.py script to detect objects using the YOLOv4 model and track one of the detected objects using the CSRT tracker:
python second.py

Note:

When you run the scripts, a window will open showing the first frame of the video. You need to select the object that you want to track by drawing a bounding box around it. After you have selected the object, press ENTER to start tracking.

Examples

Built-in OpenCV:

opencv

With YOLO:

yolo

Contributors

We would like to thank the following contributors for their valuable contributions to this project:

Special thanks to everyone who has submitted bug reports, feature requests, and provided feedback on the project.

If you would like to contribute to this project, please check out our Contribution Guidelines for more information.

License

This project is licensed under the MIT License.

You are free to use, modify, and distribute this software for any purpose, as long as the original copyright notice and license terms are included.

For more information, please refer to the LICENSE file.

About

This project is an example of object tracking in video using opencv and YOLO

License:MIT License


Languages

Language:Python 100.0%