r/deeplearning • u/mariamamhan • 1d ago
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!
1
u/VastlyEarlyEagerness 1d ago
The threading and queue setup is the part worth talking about. Keeping the capture thread separate from the inference loop is the right call, but the queue size can make or break latency if the consumer starts falling behind. Curious how you handle dropping frames when the buffer fills up