Thanks to visit codestin.com
Credit goes to github.com

Skip to content

πŸš— Effortlessly count cars in videos using YOLOv8-powered computer vision program for streamlined traffic monitoring.

Notifications You must be signed in to change notification settings

serialdotai/car-counter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš— Car Counter

Effortlessly count cars in videos using YOLOv8-powered computer vision program for streamlined traffic monitoring.

🌐 Overview

This Python script uses computer vision techniques to count vehicles in a traffic cam video. The implementation is based on the YOLO (You Only Look Once) object detection model, integrated with a SORT (Simple Online and Realtime Tracking) algorithm for tracking.

πŸš€ Features

  • Object Detection: Utilizes the YOLO model to detect vehicles in the video.

  • Tracking: Implements the SORT algorithm for real-time tracking of detected vehicles.

  • Counting: Tracks and counts vehicles crossing predefined lines in the video.

  • Visualization: Displays the output with graphical overlays indicating the total count and count in specific directions.

πŸ› οΈ Prerequisites

Make sure you have the following dependencies installed:

  • Ultralytics YOLO

  • OpenCV (cv2)

  • cvzone

  • SORT (Simple Online and Realtime Tracking)

πŸ—οΈ Setup

  1. Clone the repository:

    git clone https://github.com/serialdotai/car-counter.git
    cd car-counter
  2. Install the required packages:

    pip install -r requirements.txt
  3. Download the YOLO weights file yolov8l.pt and place it in a yolo weights directory.

  4. Run the script:

    python main.py

βš™οΈ Configuration

Adjust the following parameters in the script as needed:

  • lineUp and lineDown: Define the lines for counting vehicles in the video.
  • mask: Set the mask image for region of interest.

πŸ“Ή Output

The processed video will be saved as result.mp4 in the same directory.

πŸ™Œ Acknowledgments

About

πŸš— Effortlessly count cars in videos using YOLOv8-powered computer vision program for streamlined traffic monitoring.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages