class_docstr: Evaluate semantic segmentation
  
  Args:
      num_classes (int): number of classes
      ignore_index (int, optional): value in semantic segmentation ground truth. Predictions for the
      corresponding pixels should be ignored. Default: 255.
class_docstr_tok: ["Evaluate","semantic","segmentation","Args",":","num_classes","(","int",")",":","number","of","classes","ignore_index","(","int",",","optional",")",":","value","in","semantic","segmentation","ground","truth",".","Predictions","for","the","corresponding","pixels","should","be","ignored",".","Default",":","255","."]
code: def update(self, pred, gt):
      pred = pred.astype(np.int)
      gt = gt.astype(np.int)
      gt[gt == self._ignore_index] = self._num_classes
  
      # raw: pred, column: gt
      self._conf_matrix += np.bincount(
          self._N * pred.reshape(-1) + gt.reshape(-1),
          minlength=self._N**2,
      ).reshape(self._N, self._N)
  
imports: from collections import OrderedDict
  import numpy
label_desc: Use image node_id 2 for calling the SemanticEvaluator obj's underlying member method code with example usage: obj.update(pred, gt) without return types