Screencast.from.2024-03-18.02-32-32.webm
Track and Predict Using YOLOv7 The Fastest Object Detection Algorithm
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.
- 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.
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.
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.pyThis 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.



