- class composer.metrics.MIoU(num_classes, ignore_index=- 1)#
Torchmetrics mean Intersection-over-Union (mIoU) implementation.
IoU calculates the intersection area between the predicted class mask and the label class mask. The intersection is then divided by the area of the union of the predicted and label masks. This measures the quality of predicted class mask with respect to the label. The IoU for each class is then averaged and the final result is the mIoU score. Implementation is primarily based on mmsegmentation
Aggregate state across all processes and compute final metric.
- update(logits, targets)#
Update the state with new predictions and targets.