fit_predict#

geowombat.detect.fit_predict(src, detector, labels, class_col, out_dir, tile_size=640, overlap=0.1, epochs=50, predict_kwargs=None, **dataset_kwargs)[source]#

Build a training dataset, fine-tune, and predict in one call.

Mirrors gw.ml.fit_predict for classification: end-to-end from raster + labels to predictions.

Return type:

Tuple[GeoDataFrame, dict]

Parameters:
srcxarray.DataArray

Raster opened with gw.open().

detectorYOLODetector

Detector to fine-tune and run inference with.

labelsgeopandas.GeoDataFrame, str, or Path

Vector labels.

class_colstr

Column in labels holding class name/id.

out_dirstr or Path

Output directory for the generated YOLO dataset.

tile_sizeint

Tile edge in pixels. Default 640.

overlapfloat

Tile overlap for both dataset creation and inference. Default 0.1.

epochsint

Fine-tuning epochs. Default 50.

predict_kwargsdict, optional

Extra kwargs passed to detector.predict.

**dataset_kwargs

Extra kwargs passed to build_dataset (e.g. val_split, min_box_pixels, background_ratio, band_indices, scale, oriented).

Returns:
(geopandas.GeoDataFrame, dict)

Predictions and the dataset-build summary.