A webcam dashboard (like the screenshot) built with OpenCV + YOLOv8, showing live bounding boxes, labels, FPS, confidence, and a "Detected: ..." status bar.
python -m venv venv
venv\Scripts\activate # Windows
# source venv/bin/activate # Mac/Linux
pip install -r requirements.txtpython main.py- First run downloads
yolov8n.ptautomatically (~6MB). - Press
qto quit the window. - Edit
CAMERA_INDEXinmain.pyif you have multiple webcams. - Set
TARGET_CLASSES = {"person", "cell phone"}inmain.pyto only show those two classes (default detects all 80 COCO classes). - Edit
CLASS_COLORSto change box colors per class.
main.py— full app (detection + dashboard UI)requirements.txt— dependencies
- Uses YOLOv8n (nano) for speed; swap
MODEL_NAME = "yolov8s.pt"for higher accuracy at the cost of FPS. - All UI elements (header, sidebar, footer, heatmap-style panel) are drawn manually with OpenCV so you can freely restyle colors/fonts/layout.