https://github.com/hetbhalani/car_counter
I am learning object detection using python
https://github.com/hetbhalani/car_counter
Last synced: about 1 year ago
JSON representation
I am learning object detection using python
- Host: GitHub
- URL: https://github.com/hetbhalani/car_counter
- Owner: hetbhalani
- Created: 2024-11-05T11:29:53.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-09T11:52:53.000Z (over 1 year ago)
- Last Synced: 2025-04-14T17:12:30.236Z (about 1 year ago)
- Language: Python
- Size: 84.9 MB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Car Counting π
This is a Python-based project that uses the YOLOv8 object detection model and the SORT (Simple Online and Realtime Tracking) algorithm to count vehicles in a video feed. π₯
## Screensort πΈ

## Features π
- Real-time vehicle detection and counting π
- Supports various vehicle types (cars, trucks, buses, motorbikes) ππποΈ
- Utilizes a custom road mask to focus the detection on the desired region π£οΈ
- Tracks individual vehicles across frames using the SORT algorithm ππ€
## Tech used π»
- Python 3.x
- OpenCV π₯οΈ
- Ultralytics YOLO π€
- SORT (Simple Online and Realtime Tracking) π
- cvzone π¨
## How it Works π€
1. The code loads the YOLOv8 model and initializes the SORT tracker. π
2. It then processes each frame of the video, detecting vehicles using the YOLOv8 model and vehicle types (cars, trucks, buses, bikes). π
3. The detected vehicles are then passed to the SORT tracker, which keeps track of individual vehicles across frames. π
4. The script draws bounding boxes around the detected vehicles, displays the vehicle IDs, and counts the number of unique vehicles that have passed through the linrπ’
## βοΈ Installation
Follow these steps to run project :
1. **Clone the repository**:
```bash
git clone https://github.com/hetbhalani/Car_Counter.git
cd Car_Counter
```
2. **Install dependencies** :
```bash
pip install requirements.txt
```
3. **Run the app**:
```bash
python CarCounter.py
```
## Contributing π€
If you find any issues or have suggestions for improvements, feel free to open an issue or submit a pull request. π
## Acknowledgments π
Special thanks to Alex Bewley, the creator of the SORT (Simple Online and Realtime Tracking) algorithm, for his valuable contribution to the field of object tracking.