class_docstr: Computes pixAcc and mIoU metric scores
      
class_docstr_tok: ["Computes","pixAcc","and","mIoU","metric","scores"]
docstr: Updates the internal evaluation result.
  
  Parameters
  ----------
  labels : 'NDArray' or list of `NDArray`
      The labels of the data.
  
  preds : 'NDArray' or list of `NDArray`
      Predicted values.
docstr_tok: ["Updates","the","internal","evaluation","result",".","Parameters","--","--","--","--","--","labels",":","'NDArray","'","or","list","of","`","NDArray","`","The","labels","of","the","data",".","preds",":","'NDArray","'","or","list","of","`","NDArray","`","Predicted","values","."]
code: def update(self, labels, preds):
      """Updates the internal evaluation result.
  
      Parameters
      ----------
      labels : 'NDArray' or list of `NDArray`
          The labels of the data.
  
      preds : 'NDArray' or list of `NDArray`
          Predicted values.
      """
  
      def evaluate_worker(self, label, pred):
          correct, labeled = batch_pix_accuracy(pred, label)
          inter, union = batch_intersection_union(
              pred, label, self.nclass
          )
          with self.lock:
              self.total_correct += correct
              self.total_label += labeled
              self.total_inter += inter
              self.total_union += union
  
      if isinstance(preds, mx.nd.NDArray):
          evaluate_worker(self, labels, preds)
      elif isinstance(preds, (list, tuple)):
          threads = [
              threading.Thread(
                  target=evaluate_worker,
                  args=(self, label, pred),
              )
              for (label, pred) in zip(labels, preds)
          ]
          for thread in threads:
              thread.start()
          for thread in threads:
              thread.join()
  
file_path: gluon-cv/gluoncv/utils/metrics/segmentation.py
imports: import threading
  import numpy
  import mxnet
label_desc: Use image node_id 2 for calling the SegmentationMetric obj's underlying member method code with example usage: obj.update(labels, preds) without return types