Two version of object detection:
- Server side - suit for powerful web server.
- Client (browser) side - suit for IoT devices
This project is a lightweight web application for real-time object detection and video streaming using a webcam. Built with aiohttp for asynchronous web serving and powered by YOLOv8 (You Only Look Once) for object detection, the app processes webcam footage, detects objects in each frame, annotates them, and streams the result to a web browser in real time.
-
π§ YOLOv8-based Object Detection
Utilizes theultralyticsYOLOv8n model for fast and efficient object recognition. -
π Asynchronous Streaming
Leveragesasyncioand aThreadPoolExecutorto handle frame capture, processing, and encoding without blocking the event loop. -
π Live Video Feed in Browser
Streams video usingmultipart/x-mixed-replace, viewable in any modern web browser. -
π FPS Monitoring
Real-time FPS (frames per second) is displayed directly on the video feed for performance monitoring. -
π§ Multithreaded Execution
Handles CPU-bound operations in background threads for smoother performance.
- Python 3
- aiohttp β asynchronous HTTP server
- OpenCV β image and video processing
- Ultralytics YOLOv8 β object detection model
asyncio,concurrent.futuresβ async programming and thread pooling- HTML + Bootstrap β responsive frontend UI
-
Install the required packages:
pip install aiohttp opencv-python ultralytics
-
Run the application:
python app.py
-
Open your browser and go to: http://localhost:8080
-
View the live, annotated webcam feed in real time!