class_docstr: Compute Panoptic Quality between two instance segmentation masks. If specifying `metric_name` to "SQ" or "RQ",
  Segmentation Quality (SQ) or Recognition Quality (RQ) will be returned instead.
  
  Panoptic Quality is a metric used in panoptic segmentation tasks. This task unifies the typically distinct tasks
  of semantic segmentation (assign a class label to each pixel) and
  instance segmentation (detect and segment each object instance). Compared with semantic segmentation, panoptic
  segmentation distinguish different instances that belong to same class.
  Compared with instance segmentation, panoptic segmentation does not allow overlap and only one semantic label and
  one instance id can be assigned to each pixel.
  Please refer to the following paper for more details:
  https://openaccess.thecvf.com/content_CVPR_2019/papers/Kirillov_Panoptic_Segmentation_CVPR_2019_paper.pdf
  
  This class also refers to the following implementation:
  https://github.com/TissueImageAnalytics/CoNIC
  
  Args:
      num_classes: number of classes. The number should not count the background.
      metric_name: output metric. The value can be "pq", "sq" or "rq".
          Except for input only one metric, multiple metrics are also supported via input a sequence of metric names
          such as ("pq", "sq", "rq"). If input a sequence, a list of results with the same order
          as the input names will be returned.
      reduction: define mode of reduction to the metrics, will only apply reduction on `not-nan` values,
          available reduction modes: {``"none"``, ``"mean"``, ``"sum"``, ``"mean_batch"``, ``"sum_batch"``,
          ``"mean_channel"``, ``"sum_channel"``}, default to `self.reduction`. if "none", will not do reduction.
      match_iou_threshold: IOU threshold to determine the pairing between `y_pred` and `y`. Usually,
          it should >= 0.5, the pairing between instances of `y_pred` and `y` are identical.
          If set `match_iou_threshold` < 0.5, this function uses Munkres assignment to find the
          maximal amount of unique pairing.
      smooth_numerator: a small constant added to the numerator to avoid zero.
code: def __init__(
      self,
      num_classes: int,
      metric_name: Sequence[str] | str = "pq",
      reduction: MetricReduction | str = MetricReduction.MEAN_BATCH,
      match_iou_threshold: float = 0.5,
      smooth_numerator: float = 1e-6,
  ) -> None:
      super().__init__()
      self.num_classes = num_classes
      self.reduction = reduction
      self.match_iou_threshold = match_iou_threshold
      self.smooth_numerator = smooth_numerator
      self.metric_name = ensure_tuple(metric_name)
  
file_path: MONAI/monai/metrics/panoptic_quality.py
imports: from __future__ import annotations
  from collections.abc import Sequence
  import torch
  from monai.metrics.metric import CumulativeIterationMetric
  from monai.metrics.utils import do_metric_reduction, remap_instance_id
  from monai.utils import MetricReduction, ensure_tuple, optional_import
label_desc: Use image node_id 1 to create a new PanopticQualityMetric object from inherited base classes: CumulativeIterationMetric with example: obj = PanopticQualityMetric(num_classes, metric_name, reduction, match_iou_threshold, smooth_numerator)