This demo application demonstrates real-time object detection using a YOLOv8-based model. The app supports detection of multiple object classes and provides an interactive web interface where users can view live video feed with detected objects highlighted. Users can dynamically toggle visibility of specific object classes through the interface.
- Real-time object detection from webcam or video stream
- Supports multiple object classes (e.g., backpack, bottle, handbag, laptop, mobile-phone, paper bag)
- Dynamic label list with toggle switches to show/hide detected object classes
- Lightweight and optimized for CPU inference with ONNX model
- Python 3.8+
- Flask (for backend server)
- OpenCV (
opencv-python) - YOLOv8 model exported in ONNX format
- Other dependencies listed in
requirements.txt
-
Clone the repository:
-
Create and activate a virtual environment (optional but recommended):
-
Install dependencies:
pip install -r requirements.txt
-
Place your trained YOLOv8 model (
best.onnxmodel file) in themodels/onnx/directory.
-
Run the Flask server:
python app.py
-
Open your browser and navigate to:
http://localhost:5000 -
Allow camera access when prompted.
-
Use the interface to start/stop detection and toggle object classes on or off.
The demo uses a custom-trained YOLOv8 model that detects multiple objects relevant to daily scenarios, including:
- Backpack
- Bottle
- Handbag
- Laptop
- Mobile-phone
- Paper bag
For questions, suggestions, or collaborations, please contact:
Ayub Ali Emon
Member of CogTwins Lab
Email: [email protected]
Shandong University of Science and Technology