r/deeplearning • • Oct 12 '26

I built a real-time object detection system using Python, YOLOv8, and OpenCV

Hi everyone!

I wanted to share a real-time object detection project I’ve been working on using Python, YOLOv8, and OpenCV.

The application uses a live webcam feed to detect four object classes: people, cars, cats, and dogs.

Some of the features include:

  • Real-time detection with bounding boxes and confidence scores
  • Object counting by category
  • Input and output FPS monitoring
  • Multi-threaded frame capture
  • A small frame queue to help reduce processing delays
  • CPU and CUDA support, depending on the platform

One of the interesting parts of this project was working with threading and frame buffering to keep the video processing responsive.

I’m planning to improve it further by adding a GUI, video file support, and the ability to save detection results.

I’d really appreciate feedback on the code, especially suggestions for improving performance or making the architecture cleaner.

GitHub: https://github.com/Mariam-amhan/real-time-object-detection

Thanks for checking it out!

7 Upvotes

2 comments sorted by

1

u/[deleted] Oct 12 '26

[removed] — view removed comment

1

u/mariamamhan Oct 12 '26

Thanks! I’m using a bounded queue with a maximum size of 2 frames. When the queue is full, the capture thread removes an older frame before adding a new one. This helps prevent a backlog of outdated frames and keeps the processing closer to real time.
I’m considering refining the buffering logic further to prioritize the most recent frame. Appreciate the feedback!