YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
cv-uav
Computer vision + YOLO pipeline for detecting edge-rich objects (triangles/hexagons) in a field and running YOLO only when the CV gate triggers.
What this does
- Captures real-time frames from a camera (including iPhone via USB if it shows up as a camera device)
- Runs grayscale + Canny edge detection
- Finds long straight lines via HoughLinesP
- Detects regular polygons (triangles, hexagons, etc.) from contours
- Computes edge density + angular variance
- Runs YOLO inference only when the CV gate indicates likely targets
- Draws bounding boxes and CV overlays on the laptop display
Setup
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
Notes:
ultralyticsdepends on PyTorch. If PyTorch is not installed, follow the official install instructions for your system.
Dataset layout (YOLOv8)
Create your dataset under data/ and update data/dataset.yaml with the right class names.
data/
images/
train/
val/
labels/
train/
val/
dataset.yaml
Train YOLOv8
python train_yolo.py --data data/data.yaml --model yolov8n.pt --epochs 50 --imgsz 640
Checkpoints are saved under checkpoints/ and also copied to:
checkpoints/best.ptcheckpoints/last.pt
Run the live CV + YOLO pipeline
python main.py --source 0 --model checkpoints/best.pt
Useful options:
--list-devicesto probe available camera indices--source 1or--source 2if your iPhone shows up as another index--model checkpoints/best.ptto run your trained model
Using an iPhone over USB-C
- On macOS, iPhone can appear as a camera via Continuity Camera. Unlock the iPhone and open any camera-using app once so it registers, then use
--list-devicesto find the index. - On other OSes, you may need a camera bridge app (e.g., Camo/DroidCam). Use the app’s provided device/stream URL as
--source.
Project plan
See PROJECT_PLAN.md for the full, detailed plan and milestones.
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support