open3d.ml.tf.modules.metrics.SemSegMetric

class open3d.ml.tf.modules.metrics.SemSegMetric

Metrics for semantic segmentation.

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

__init__()

Initialize self. See help(type(self)) for accurate signature.

acc()

Compute the per-class accuracies and the overall accuracy.

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

  • labels (tf.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 (tf.FloatTensor, shape (B?, N, C) – raw scores for each class.

  • labels (tf.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 (tf.FloatTensor, shape (B?, C, N) – raw scores for each class.

  • labels (tf.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)