class_docstr: Combines semantic segmentation confusion matrices.
class_docstr_tok: ["Combines","semantic","segmentation","confusion","matrices","."]
code: def extract_output(
      self, accumulator: Dict[int, Matrix]
  ) -> Dict[metric_types.MetricKey, Matrix]:
      result = {}
      for class_id, confusion_matrix_matrix in accumulator.items():
          new_key = self._key._replace(
              sub_key=metric_types.SubKey(class_id=class_id)
          )
          # In semantic segmentation metrics, there is no confidence score and thus
          # no thresholds. It is set to 0 as default to reuse the binary confusion
          # matrices.
          matrices = Matrix(
              tp=confusion_matrix_matrix.tp,
              tn=confusion_matrix_matrix.tn,
              fp=confusion_matrix_matrix.fp,
              fn=confusion_matrix_matrix.fn,
          )
          result[new_key] = matrices
      return result
  
imports: import abc
  from typing import Any, Dict, Iterable, List, Optional, Union
  import apache_beam
  import numpy
  from tensorflow_model_analysis.contrib.aggregates import binary_confusion_matrices
  from tensorflow_model_analysis.metrics import metric_types
  from tensorflow_model_analysis.metrics import metric_util
  from tensorflow_model_analysis.metrics import preprocessors
  from tensorflow_model_analysis.proto import config_pb2
label_desc: Use image node_id 5 for calling the _SemanticSegmentationConfusionMatrixCombiner obj's underlying member method code with example usage: obj.extract_output(accumulator) and returns: result