detection_accuracy#
- geowombat.detect.detection_accuracy(predictions, truth, class_col='class_name', iou_thresholds=(0.5,), score_col='score', class_agnostic=False)[source]#
Compute detection accuracy metrics + a review-ready GeoDataFrame.
- Parameters:
- predictionsgeopandas.GeoDataFrame
Detector output. Must include
geometry,score(orscore_col), and a class column.- truthgeopandas.GeoDataFrame
Ground-truth boxes/polygons in the same CRS.
- class_colstr
Column with class labels in both inputs.
- iou_thresholdssequence of float, or ‘coco’
IoU thresholds to evaluate.
'coco'expands to 0.5..0.95 step 0.05 and returns mAP@[.5:.95].- score_colstr
Score column in predictions. Default ‘score’.
- class_agnosticbool
If True, ignore class labels (treat as a single class).
- Returns:
- dict
- Keys:
metrics: DataFrame indexed by class with columnsprecision, recall, f1, ap, tp, fp, fn, supportfor each IoU threshold.summary: dict of overall mAP per threshold + mAP@[.5:.95].matched: GeoDataFrame of TP/FP/FN rows ready for QGIS review (seeexport_for_review).confusion: DataFrame of class confusion (per-class truth vs. matched-prediction class) at the lowest IoU.