code: def setUp(self):
      super().setUp()
      label_image_array = np.array(
          [[1, 2, 3], [1, 2, 3]], dtype=np.uint8
      )
      prediction_image_array = np.array(
          [[1, 1, 1], [2, 2, 2]], dtype=np.uint8
      )
      label_encoded_image = _encode_image_from_nparray(
          label_image_array
      )
      prediction_encoded_image = _encode_image_from_nparray(
          prediction_image_array
      )
  
      label_image_array2 = np.array(
          [[2, 2, 3], [1, 2, 3]], dtype=np.uint8
      )
      prediction_image_array2 = np.array(
          [[2, 1, 1], [2, 2, 2]], dtype=np.uint8
      )
      label_encoded_image2 = _encode_image_from_nparray(
          label_image_array2
      )
      prediction_encoded_image2 = _encode_image_from_nparray(
          prediction_image_array2
      )
  
      self._extracts = [
          {
              "features": {
                  constants.LABELS_KEY: {
                      "image/encoded": np.array([label_encoded_image]),
                  },
                  constants.PREDICTIONS_KEY: {
                      "image/pred/encoded": np.array(
                          [prediction_encoded_image]
                      ),
                  },
              }
          },
          {
              "features": {
                  constants.LABELS_KEY: {
                      "image/encoded": np.array([label_encoded_image2]),
                  },
                  constants.PREDICTIONS_KEY: {
                      "image/pred/encoded": np.array(
                          [prediction_encoded_image2]
                      ),
                  },
              }
          },
      ]
  
file_path: model-analysis/tensorflow_model_analysis/metrics/semantic_segmentation_confusion_matrix_metrics_test.py
imports: import io
  from absl.testing import absltest
  from absl.testing import parameterized
  import apache_beam
  from apache_beam.testing import util
  import numpy
  from PIL import Image
  import tensorflow_model_analysis
  from tensorflow_model_analysis import constants
  from tensorflow_model_analysis.contrib.aggregates import binary_confusion_matrices
  from tensorflow_model_analysis.metrics import metric_types
  from google.protobuf import text_format
label_desc: Use image node_id 1 for calling the SegmentationConfusionMatrixTest obj's underlying member method code with example usage: obj.setUp() without return types