YOLODetector#

class geowombat.detect.YOLODetector(weights='yolov8n.pt', classes=None, oriented=None, device='auto', imgsz=None)[source]#

Bases: GeoWombatDetector

Ultralytics YOLO detector for georeferenced rasters.

Supports axis-aligned (default) and oriented bounding boxes. The underlying model is any path accepted by ultralytics.YOLO — pretrained weights (‘yolov8n.pt’, ‘yolo11n.pt’, ‘yolov8n-obb.pt’) or a custom-trained checkpoint.

NOTE: Ultralytics is licensed AGPL-3.0; ensure your use case is compatible before deploying.

Parameters:
weightsstr or Path

YOLO weights file. Default ‘yolov8n.pt’.

classeslist of str, optional

Override class names. If None, names come from the model.

orientedbool

Set to True when using an OBB weight (file ends in -obb.pt). Auto-detected from the filename if not specified.

devicestr

‘cpu’, ‘cuda’, or ‘auto’. Default ‘auto’.

imgszint

Inference size passed to YOLO. Default matches tile_size in predict().

Attributes:
class_names

Methods

fit(dataset_yaml[, epochs, imgsz])

Fine-tune YOLO on a dataset produced by build_yolo_dataset.

predict(src[, tile_size, overlap, conf, ...])

Run tiled, georeferenced inference over a raster.

Methods Summary

fit(dataset_yaml[, epochs, imgsz])

Fine-tune YOLO on a dataset produced by build_yolo_dataset.

Methods Documentation

fit(dataset_yaml, epochs=50, imgsz=640, **kwargs)[source]#

Fine-tune YOLO on a dataset produced by build_yolo_dataset.

Thin wrapper around ultralytics.YOLO.train.

Parameters:
dataset_yamlstr or Path

Path to data.yaml written by build_yolo_dataset.

epochsint

Training epochs. Default 50.

imgszint

Training image size. Default 640.

**kwargs

Additional kwargs forwarded to YOLO.train.

fit(dataset_yaml, epochs=50, imgsz=640, **kwargs)[source]#

Fine-tune YOLO on a dataset produced by build_yolo_dataset.

Thin wrapper around ultralytics.YOLO.train.

Parameters:
dataset_yamlstr or Path

Path to data.yaml written by build_yolo_dataset.

epochsint

Training epochs. Default 50.

imgszint

Training image size. Default 640.

**kwargs

Additional kwargs forwarded to YOLO.train.