Skip to content

fh1m/Track_and_Predict

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Screencast.from.2024-03-18.02-32-32.webm

Track and Predict Using YOLOv7 The Fastest Object Detection Algorithm

only works for Bottles, hehe

This project leverages a powerful object detection system using YOLOv7 integrated with OpenCV to track a bottle in real-time via a webcam feed. It provides dynamic detection, tracking, and Prediction of the bottle's direction and speed relative to a predefined reference point.

Features

  • Real-time video feed acquisition from a webcam.
  • Object detection using the pre-trained YOLOv7 model.
  • Customizable tracking of a bottle's position within the camera's field of view.
  • Direction and speed prediction of the bottle's movement in pixels per second.
  • Visual output displayed in an OpenCV window.

Prerequisites

Before running this project, ensure you have the following installed:

  • Python 3.8 or above
  • OpenCV library
  • PyTorch
  • PIL (Python Imaging Library)

Additionally, ensure you have the YOLOv7 model weights placed in the correct directory.

Usage

To run the bottle tracking system, execute the main.py script:

foo@bar:~$ python -m venv env
foo@bar:~$ pip install -r requirements.txt
foo@bar:~$ source env/bin/activate
foo@bar:~$ python main.py

This will activate the webcam and start the object detection and tracking process. The live video feed will display the tracked bottle with a bounding box. Direction and speed information and prediction will be shown in the bottom and top corners of the OpenCV window.

Time for some Real stuff

Working Examples

Screenshot from 2024-03-18 02-29-17

Screenshot from 2024-03-18 02-29-28

Tested in Different lighting conditions

Screenshot from 2024-03-18 02-29-46

Screenshot from 2024-03-18 02-29-56

About

Simple but fun ML project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published