Skip to content

dice2

dice2

dice2(
    true: ndarray, pred: ndarray, eps: float = 1e-08
) -> float

Compute the DICE2 metric for a labelled mask.

Parameters

true : np.ndarray
    Ground truth (labelled mask). Shape (H, W).
pred : np.ndarray
    Predicted (labelled mask). Shape (H, W).
eps : float, default=1e-8:
    Epsilon to avoid zero div errors.

Returns

float:
    The computed dice2 metric.