open3d.ml.torch.modules.metrics.SemSegMetric#

class open3d.ml.torch.modules.metrics.SemSegMetric#

Metrics for semantic segmentation.

Accumulate confusion matrix over training loop and computes accuracy and mean IoU.

__init__()#
acc()#

Compute the per-class accuracies and the overall accuracy.

Parameters:
  • scores (torch.FloatTensor, shape (B?, C, N) – raw scores for each class.

  • labels (torch.LongTensor, shape (B?, N)) – ground truth labels.

Returns:

A list of floats of length num_classes+1. Consists of per class accuracy. Last item is Overall Accuracy.

static get_confusion_matrix(scores, labels)#

Computes the confusion matrix of one batch

Parameters:
  • scores (torch.FloatTensor, shape (B?, N, C) – raw scores for each class.

  • labels (torch.LongTensor, shape (B?, N)) – ground truth labels.

Returns:

Confusion matrix for current batch.

iou()#

Compute the per-class IoU and the mean IoU.

Parameters:
  • scores (torch.FloatTensor, shape (B?, C, N) – raw scores for each class.

  • labels (torch.LongTensor, shape (B?, N)) – ground truth labels.

Returns:

A list of floats of length num_classes+1. Consists of per class IoU. Last item is mIoU.

reset()#
update(scores, labels)#