code: def print_semantic_table(
      results: dict,
      class_names: list,
      logger: Optional[Union["MMLogger", str]] = None,
  ) -> None:
      """Print semantic segmentation evaluation results table.
  
      Args:
          results (dict): The evaluation results.
          class_names (list): Class names.
          logger (MMLogger | str, optional): Logger used for printing.
              Default: None.
      """
      # each class table
      results.pop("aAcc", None)
      ret_metrics_class = OrderedDict(
          {
              ret_metric: np.round(ret_metric_value * 100, 2)
              for ret_metric, ret_metric_value in results.items()
          }
      )
  
      print_log("per class results:", logger)
      if PrettyTable:
          class_table_data = PrettyTable()
          ret_metrics_class.update({"Class": class_names})
          ret_metrics_class.move_to_end("Class", last=False)
          for key, val in ret_metrics_class.items():
              class_table_data.add_column(key, val)
          print_log("\n" + class_table_data.get_string(), logger=logger)
      else:
          logger.warning(
              "`prettytable` is not installed, for better table format, "
              'please consider installing it with "pip install prettytable"'
          )
          print_result = {}
          for class_name, iou, acc in zip(
              class_names,
              ret_metrics_class["IoU"],
              ret_metrics_class["Acc"],
          ):
              print_result[class_name] = {"IoU": iou, "Acc": acc}
          print_log(print_result, logger)
  
imports: import os.path
  from collections import OrderedDict
  from typing import Dict, Optional, Sequence, Union
  import numpy
  import torch
  from mmcv import imwrite
  from mmengine.dist import is_main_process
  from mmengine.evaluator import BaseMetric
  from mmengine.logging import MMLogger, print_log
  from mmengine.utils import mkdir_or_exist
  from PIL import Image
  from mmdet.registry import METRICS
label_desc: Use image node_id 1 for calling a global function with example usage: print_semantic_table(results, class_names, logger) without return types