Skip to content

Sean578-hub/YOLO-Object-Counter-App

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

YOLO Object Counter App (Python + OpenCV + YOLOv8)

Project Description

This project is a real-time object detection and counting application built using Python and the YOLOv8 model.

The program captures video from a webcam and uses the YOLO object detection model to identify objects in each frame. Detected objects are highlighted with bounding boxes and labels, and the total number of detected objects is displayed on the screen.

This project demonstrates how modern deep learning models can be used for real-time computer vision applications.


Technologies

  • Python
  • OpenCV (cv2)
  • YOLOv8 (Ultralytics)
  • NumPy

How It Works

  1. The program loads the YOLOv8 object detection model.
  2. The webcam captures live video frames.
  3. Each frame is processed by the YOLO model.
  4. The model detects objects in the frame.
  5. Bounding boxes and labels are drawn around detected objects.
  6. The system counts the number of detected objects.
  7. The total object count is displayed on the screen in real time.

How to Run

Install the required libraries:

pip install ultralytics
pip install opencv-python
pip install numpy

Run the program:

python main.py

Make sure the YOLO model file (yolov8n.pt) is available or downloaded automatically by the Ultralytics library.


Example Output

The program opens the webcam and displays:

  • Bounding boxes around detected objects
  • Object labels (person, car, etc.)
  • A real-time counter showing the number of detected objects

Example display:

Objects detected: 5


Project Purpose

This project demonstrates how deep learning object detection models such as YOLO can be used for real-time video analysis.

Applications of similar systems include:

  • traffic monitoring
  • people counting in buildings
  • security surveillance
  • smart retail analytics

Future Improvements

Possible improvements include:

  • Counting specific object classes (e.g., only people or cars)
  • Saving detection results to a file
  • Adding a graphical interface
  • Using video files instead of a webcam
  • Improving performance with GPU acceleration

Author

Sean Michaeli

About

Real-time object detection and counting application built with Python, OpenCV, and YOLOv8 that detects and counts objects from a live webcam feed.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages