satellit_sam.workflows.label.validate_predictions
satellit_sam.workflows.label.validate_predictions
Auto-generated from
satellit_sam/src/satellit_sam/workflows/label/validate_predictions.pybysatellit_sam/scripts/generate_api_docs.py.
Validate SAM3 strong labels against inventory stem positions.
Functions
validate_sam3_predictions
def validate_sam3_predictions(
image_tif: Path,
predictions_npz: Path | None = None,
predictions_tiles_dir: Path | None = None,
output_csv: Path = Path("output/validation/label_validation.csv"),
inventory_csv: Path | None = None,
inventory_shp: Path | None = None,
x_field: str = "PX",
y_field: str = "PY",
tree_id_field: str = "TreeID",
stem_id_field: str = "StemTag",
species_field: str = "Latin",
status_field: str = "Status",
status_filter: str = "alive",
dbh_field: str = "DBH",
dbh_unit: DbhUnit = "mm",
min_dbh_cm: float = 0.0,
max_dbh_cm: float = 0.0,
deduplicate_tree_id: bool = False,
) -> pd.DataFrame:
Validate SAM3 strong-label masks against inventory stems.
Arguments
image_tif: GeoTIFF used to map inventory trees into image pixel space. predictions_npz: Optional path to SAM3 ``image_masks.npz`` artifact. predictions_tiles_dir: Optional path to per-tile mask NPZ directory. output_csv: Output CSV path for validation rows. inventory_csv: Optional inventory CSV path. inventory_shp: Optional inventory SHP path. x_field: Inventory CSV x-offset field. y_field: Inventory CSV y-offset field. tree_id_field: Inventory tree-id field. stem_id_field: Inventory stem-id field. species_field: Inventory species field. status_field: Inventory status field. status_filter: Optional status filter (case-insensitive). dbh_field: Inventory DBH field. dbh_unit: Unit for DBH values. min_dbh_cm: Minimum DBH threshold in cm. max_dbh_cm: Maximum DBH threshold in cm (``<=0`` disables upper bound). deduplicate_tree_id: Keep one row per tree id with highest DBH.
Returns
DataFrame with columns ``tree_id, stem_id, label_id, tree_pos_x, tree_pos_y, prediction_coverage``.
Exceptions
ValueError: If inputs are invalid or prediction payload is malformed.
Classes
No public classes.