MIR.image_similarity.DiceΒΆ

Dice loss and helper utilities for segmentation evaluation.

Functions

build_k_hot_from_int(y_int, idx)

Build a K-hot tensor for selected class indices.

sparse_dice_from_int_labels(src_lbl_int, ...)

Compute Dice on K sampled classes without full one-hot.

Classes

DiceLoss(*args, **kwargs)

Soft Dice loss for multi-class segmentations.

SparseDiceLoss(*args, **kwargs)

Sampled multi-class Dice over integer labels without dense full one-hot.