- class composer.metrics.Dice(num_classes)#
The Dice Coefficient for evaluating image segmentation.
The Dice Coefficient measures how similar predictions and targets are. More concretely, it is computed as 2 * the Area of Overlap divided by the total number of pixels in both images.
num_classes (int) – the number of classes in the segmentation task.
Aggregate the state over all processes to compute the metric.
- update(preds, targets)#
Update the state based on new predictions and targets.