Real-time object detection using a webcam, combining a general-purpose YOLO model with a custom-trained adapter/device detector.
- Live webcam feed — captures frames from your webcam in real time
- General object detection — uses
yolo11n.ptto detect everyday objects (people, cups, chairs, etc.) - Custom device detection — uses a fine-tuned
adapter_detector.ptmodel to detect a specific device/adapter class on top of the general detections - Both sets of detections are overlaid on the same frame and displayed in a window
| File | Description |
|---|---|
object_detector.py |
Run real-time detection using both models |
train.py |
Fine-tune yolo11n-seg.pt on the custom adapter dataset |
detecting_adapter/data.yaml |
Dataset config for the custom training |
python -m venv .venv
source .venv/bin/activate
pip install ultralytics opencv-pythonYou will also need the model weights (not included in the repo):
yolo11n.pt— download from Ultralyticsyolo11n-seg.pt— same source, segmentation variantadapter_detector.pt— produced by runningtrain.py
python train.pyTrains for 100 epochs on the adapter dataset and saves the best weights as adapter_detector.pt.
python object_detector.pyPress q to quit.