https://github.com/alihassanml/yolov8-objecttracker
A real-time object detection and tracking application using YOLOv8, OpenCV, and CVZone. This project detects objects from a video feed or webcam and draws bounding boxes with confidence scores around the detected objects.
https://github.com/alihassanml/yolov8-objecttracker
computer-vision cvzone yolov10 yolov8
Last synced: about 2 months ago
JSON representation
A real-time object detection and tracking application using YOLOv8, OpenCV, and CVZone. This project detects objects from a video feed or webcam and draws bounding boxes with confidence scores around the detected objects.
- Host: GitHub
- URL: https://github.com/alihassanml/yolov8-objecttracker
- Owner: alihassanml
- License: mit
- Created: 2024-09-14T15:59:39.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-09-14T16:23:25.000Z (about 1 year ago)
- Last Synced: 2025-02-21T11:26:42.660Z (8 months ago)
- Topics: computer-vision, cvzone, yolov10, yolov8
- Language: Jupyter Notebook
- Homepage:
- Size: 439 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# YOLOv8-ObjectTracker
A real-time object detection and tracking application using YOLOv8, OpenCV, and CVZone. This project detects objects from a video feed or webcam and draws bounding boxes with confidence scores around the detected objects.
## Features
- **Real-Time Object Detection**: Uses YOLOv8 for accurate object detection in real-time.
- **Object Tracking**: Visualizes object bounding boxes and class labels.
- **Customizable Classes**: Predefined COCO dataset classes.
- **Video/Live Feed**: Supports webcam or video file inputs.
## Demo
## Requirements
- Python 3.x
- OpenCV
- Ultralytics YOLOv8
- CVZone## Installation
1. Clone the repository:
```bash
git clone https://github.com/alihassanml/YOLOv8-ObjectTracker.git
cd YOLOv8-ObjectTracker
```2. Create and activate a virtual environment (optional but recommended):
```bash
python -m venv venv
source venv/bin/activate # On Windows use `venv\Scripts\activate`
```3. Install dependencies:
```bash
pip install -r requirements.txt
```4. Download YOLOv8 weights:
Place the YOLOv8 model weights (`yolov8n.pt`) in the `weights/` directory.
## Usage
Run the following command to start object detection with a webcam:
```bash
python app.py
```### Adjusting the Detection Classes
You can customize the object detection classes by modifying the `classNames` list in the code.
## Code Explanation
The main components of this project include:
- **YOLOv8**: Used for object detection.
- **OpenCV**: To handle video input and display.
- **CVZone**: For better visualization of bounding boxes and labels.```python
import os
import cv2
import math
import cvzone
from ultralytics import YOLO# Load the YOLOv8 model
model = YOLO('weights/yolov8n.pt')# Predefined COCO classes
classNames = ["person", "bicycle", "car", "motorbike", "aeroplane", ...]
```## Contributing
Feel free to submit issues, fork the repository, and make pull requests. Contributions are welcome!
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.