class_docstr: Confusion Matrix for segmentation evaluation.
  
  Args:
      num_classes (int): Number of categories of the confusion matrix.
      streaming (bool): Whether to use streaming mode. If the value is set to True, the data will be
                        accumulated every time the `calculate` interface is called. Default to False.
code: def mean_iou(self) -> float:
      iou_list = []
      avg_iou = 0
      # TODO: use numpy sum axis api to simpliy
      vji = np.zeros(self.num_classes, dtype=int)
      vij = np.zeros(self.num_classes, dtype=int)
      for j in range(self.num_classes):
          v_j = 0
          for i in range(self.num_classes):
              v_j += self.confusion_matrix[j][i]
          vji[j] = v_j
  
      for i in range(self.num_classes):
          v_i = 0
          for j in range(self.num_classes):
              v_i += self.confusion_matrix[j][i]
          vij[i] = v_i
  
      for c in range(self.num_classes):
          total = vji[c] + vij[c] - self.confusion_matrix[c][c]
          if total == 0:
              iou = 0
          else:
              iou = float(self.confusion_matrix[c][c]) / total
          avg_iou += iou
          iou_list.append(iou)
      avg_iou = float(avg_iou) / float(self.num_classes)
      return np.array(iou_list), avg_iou
  
imports: import os
  from typing import Callable, Union, List, Tuple
  import cv2
  import paddle
  import PIL
  import numpy
  import paddle.nn.functional
  from scipy.sparse import csr_matrix
label_desc: Use image node_id 4 for calling the ConfusionMatrix obj's underlying member method code with example usage: obj.mean_iou() and returns: np,  avg_iou