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 __init__(self, num_classes: int, streaming: bool = False):
      self.confusion_matrix = np.zeros(
          [num_classes, num_classes], dtype="int64"
      )
      self.num_classes = num_classes
      self.streaming = streaming
  
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 1 to create a new ConfusionMatrix object from inherited base classes: object with example: obj = ConfusionMatrix(num_classes, streaming)