Skip to main content

ml_dl.full_metrics

ml_dl.full_metrics(model, loader, threshold=0.5, device='cpu')

Run a torch segmentation model over a DataLoader and aggregate.

Returns the same dict shape as :func:binary_pixel_metrics so a leaderboard row can carry an LR / RF / XGB / U-Net result with one schema.

Expects each batch from loader to be (x, y[, meta]) where x is float32 of shape (B, C, H, W) and y is long of shape (B, H, W) with valid labels in {0, 1} and ignored pixels at -1.