class_docstr: Streaming interface to allow for any source of predictions. 
  Initialize it, count predictions one by one, then print confusion matrix and intersection-union score
class_docstr_tok: ["Streaming","interface","to","allow","for","any","source","of","predictions",".","Initialize","it",",","count","predictions","one","by","one",",","then","print","confusion","matrix","and","intersection-union","score"]
docstr: Computes the intersection over union of each class in the 
  confusion matrix
  Return:
      (iou, missing_class_mask) - iou for class as well as a mask highlighting existing classes
docstr_tok: ["Computes","the","intersection","over","union","of","each","class","in","the","confusion","matrix","Return",":","(","iou",",","missing_class_mask",")","-","iou","for","class","as","well","as","a","mask","highlighting","existing","classes"]
code: def get_intersection_union_per_class(self):
      """Computes the intersection over union of each class in the
      confusion matrix
      Return:
          (iou, missing_class_mask) - iou for class as well as a mask highlighting existing classes
      """
      TP_plus_FN = np.sum(self.confusion_matrix, axis=0)
      TP_plus_FP = np.sum(self.confusion_matrix, axis=1)
      TP = np.diagonal(self.confusion_matrix)
      union = TP_plus_FN + TP_plus_FP - TP
      iou = 1e-8 + TP / (union + 1e-8)
      existing_class_mask = union > 1e-3
      return iou, existing_class_mask
  
file_path: torch-points3d/torch_points3d/metrics/confusion_matrix.py
imports: import numpy
  import torch
  import os
label_desc: Use image node_id 6 for calling the ConfusionMatrix obj's underlying member method code with example usage: obj.get_intersection_union_per_class() and returns: iou,  existing_class_mask