minerva.analysis.metrics.pixel_accuracy

Classes

PixelAccuracy

Initializes a PixelAccuracy metric object.

Module Contents

class minerva.analysis.metrics.pixel_accuracy.PixelAccuracy(dist_sync_on_step=False)

Bases: torchmetrics.Metric

Initializes a PixelAccuracy metric object.

Parameters

dist_sync_on_step: bool, optional

Whether to synchronize metric state across processes at each step. Defaults to False.

compute()

Computes the pixel accuracy.

Returns:

float: The pixel accuracy.

Return type:

float

update(preds, target)

Updates the metric state with the predictions and targets.

Parameters

preds: torch.Tensor

The predicted tensor.

target:

torch.Tensor The target tensor.

Parameters:
  • preds (torch.Tensor)

  • target (torch.Tensor)