class_docstr: Compute `Modified Panoptic Quality`_ for panoptic segmentations.
  
  The metric was introduced in `Seamless Scene Segmentation paper`_, and is an adaptation of the original
  `Panoptic Quality`_ where the metric for a stuff class is computed as
  
  .. math::
      PQ^{\dagger}_c = \frac{IOU_c}{|S_c|}
  
  where :math:`IOU_c` is the sum of the intersection over union of all matching segments for a given class, and
  :math:`|S_c|` is the overall number of segments in the ground truth for that class.
  
  .. note:
      Points in the target tensor that do not map to a known category ID are automatically ignored in the metric
      computation.
  
  Args:
      things:
          Set of ``category_id`` for countable things.
      stuffs:
          Set of ``category_id`` for uncountable stuffs.
      allow_unknown_preds_category:
          Boolean flag to specify if unknown categories in the predictions are to be ignored in the metric
          computation or raise an exception when found.
  
  
  Raises:
      ValueError:
          If ``things``, ``stuffs`` have at least one common ``category_id``.
      TypeError:
          If ``things``, ``stuffs`` contain non-integer ``category_id``.
  
  Example:
      >>> from torch import tensor
      >>> from torchmetrics.detection import ModifiedPanopticQuality
      >>> preds = tensor([[[0, 0], [0, 1], [6, 0], [7, 0], [0, 2], [1, 0]]])
      >>> target = tensor([[[0, 1], [0, 0], [6, 0], [7, 0], [6, 0], [255, 0]]])
      >>> pq_modified = ModifiedPanopticQuality(things = {0, 1}, stuffs = {6, 7})
      >>> pq_modified(preds, target)
      tensor(0.7667, dtype=torch.float64)
class_docstr_tok: ["Compute","`","Modified","Panoptic","Quality","`","_","for","panoptic","segmentations",".","The","metric","was","introduced","in","`","Seamless","Scene","Segmentation","paper","`","_",",","and","is","an","adaptation","of","the","original","`","Panoptic","Quality","`","_","where","the","metric","for","a","stuff","class","is","computed","as","..","math",":",":","PQ^","{","\\dagger","}","_c","=","\\frac","{","IOU_c","}","{","|S_c|","}","where",":","math",":","`","IOU_c","`","is","the","sum","of","the","intersection","over","union","of","all","matching","segments","for","a","given","class",",","and",":","math",":","`","|S_c|","`","is","the","overall","number","of","segments","in","the","ground","truth","for","that","class",".","..","note",":","Points","in","the","target","tensor","that","do","not","map","to","a","known","category","ID","are","automatically","ignored","in","the","metric","computation",".","Args",":","things",":","Set","of","``","category_id","``","for","countable","things",".","stuffs",":","Set","of","``","category_id","``","for","uncountable","stuffs",".","allow_unknown_preds_category",":","Boolean","flag","to","specify","if","unknown","categories","in","the","predictions","are","to","be","ignored","in","the","metric","computation","or","raise","an","exception","when","found",".","Raises",":","ValueError",":","If","``","things","``",",","``","stuffs","``","have","at","least","one","common","``","category_id","``",".","TypeError",":","If","``","things","``",",","``","stuffs","``","contain","non-integer","``","category_id","``",".","Example",":",">",">",">","from","torch","import","tensor",">",">",">","from","torchmetrics.detection","import","ModifiedPanopticQuality",">",">",">","preds","=","tensor","(","[","[","[","0",",","0","]",",","[","0",",","1","]",",","[","6",",","0","]",",","[","7",",","0","]",",","[","0",",","2","]",",","[","1",",","0","]","]","]",")",">",">",">","target","=","tensor","(","[","[","[","0",",","1","]",",","[","0",",","0","]",",","[","6",",","0","]",",","[","7",",","0","]",",","[","6",",","0","]",",","[","255",",","0","]","]","]",")",">",">",">","pq_modified","=","ModifiedPanopticQuality","(","things","=","{","0",",","1","}",",","stuffs","=","{","6",",","7","}",")",">",">",">","pq_modified","(","preds",",","target",")","tensor","(","0.7667",",","dtype=torch.float64",")"]
docstr: Plot a single or multiple values from the metric.
  
  Args:
      val: Either a single result from calling `metric.forward` or `metric.compute` or a list of these results.
          If no value is provided, will automatically call `metric.compute` and plot that result.
      ax: An matplotlib axis object. If provided will add plot to that axis
  
  Returns:
      Figure object and Axes object
  
  Raises:
      ModuleNotFoundError:
          If `matplotlib` is not installed
  
  .. plot::
      :scale: 75
  
      >>> from torch import tensor
      >>> from torchmetrics.detection import ModifiedPanopticQuality
      >>> preds = tensor([[[[6, 0], [0, 0], [6, 0], [6, 0]],
      ...                  [[0, 0], [0, 0], [6, 0], [0, 1]],
      ...                  [[0, 0], [0, 0], [6, 0], [0, 1]],
      ...                  [[0, 0], [7, 0], [6, 0], [1, 0]],
      ...                  [[0, 0], [7, 0], [7, 0], [7, 0]]]])
      >>> target = tensor([[[[6, 0], [0, 1], [6, 0], [0, 1]],
      ...                   [[0, 1], [0, 1], [6, 0], [0, 1]],
      ...                   [[0, 1], [0, 1], [6, 0], [1, 0]],
      ...                   [[0, 1], [7, 0], [1, 0], [1, 0]],
      ...                   [[0, 1], [7, 0], [7, 0], [7, 0]]]])
      >>> metric = ModifiedPanopticQuality(things = {0, 1}, stuffs = {6, 7})
      >>> metric.update(preds, target)
      >>> fig_, ax_ = metric.plot()
  
  .. plot::
      :scale: 75
  
      >>> # Example plotting multiple values
      >>> from torch import tensor
      >>> from torchmetrics.detection import ModifiedPanopticQuality
      >>> preds = tensor([[[[6, 0], [0, 0], [6, 0], [6, 0]],
      ...                  [[0, 0], [0, 0], [6, 0], [0, 1]],
      ...                  [[0, 0], [0, 0], [6, 0], [0, 1]],
      ...                  [[0, 0], [7, 0], [6, 0], [1, 0]],
      ...                  [[0, 0], [7, 0], [7, 0], [7, 0]]]])
      >>> target = tensor([[[[6, 0], [0, 1], [6, 0], [0, 1]],
      ...                   [[0, 1], [0, 1], [6, 0], [0, 1]],
      ...                   [[0, 1], [0, 1], [6, 0], [1, 0]],
      ...                   [[0, 1], [7, 0], [1, 0], [1, 0]],
      ...                   [[0, 1], [7, 0], [7, 0], [7, 0]]]])
      >>> metric = ModifiedPanopticQuality(things = {0, 1}, stuffs = {6, 7})
      >>> vals = []
      >>> for _ in range(20):
      ...     vals.append(metric(preds, target))
      >>> fig_, ax_ = metric.plot(vals)
docstr_tok: ["Plot","a","single","or","multiple","values","from","the","metric",".","Args",":","val",":","Either","a","single","result","from","calling","`","metric.forward","`","or","`","metric.compute","`","or","a","list","of","these","results",".","If","no","value","is","provided",",","will","automatically","call","`","metric.compute","`","and","plot","that","result",".","ax",":","An","matplotlib","axis","object",".","If","provided","will","add","plot","to","that","axis","Returns",":","Figure","object","and","Axes","object","Raises",":","ModuleNotFoundError",":","If","`","matplotlib","`","is","not","installed","..","plot",":",":",":","scale",":","75",">",">",">","from","torch","import","tensor",">",">",">","from","torchmetrics.detection","import","ModifiedPanopticQuality",">",">",">","preds","=","tensor","(","[","[","[","[","6",",","0","]",",","[","0",",","0","]",",","[","6",",","0","]",",","[","6",",","0","]","]",",","...","[","[","0",",","0","]",",","[","0",",","0","]",",","[","6",",","0","]",",","[","0",",","1","]","]",",","...","[","[","0",",","0","]",",","[","0",",","0","]",",","[","6",",","0","]",",","[","0",",","1","]","]",",","...","[","[","0",",","0","]",",","[","7",",","0","]",",","[","6",",","0","]",",","[","1",",","0","]","]",",","...","[","[","0",",","0","]",",","[","7",",","0","]",",","[","7",",","0","]",",","[","7",",","0","]","]","]","]",")",">",">",">","target","=","tensor","(","[","[","[","[","6",",","0","]",",","[","0",",","1","]",",","[","6",",","0","]",",","[","0",",","1","]","]",",","...","[","[","0",",","1","]",",","[","0",",","1","]",",","[","6",",","0","]",",","[","0",",","1","]","]",",","...","[","[","0",",","1","]",",","[","0",",","1","]",",","[","6",",","0","]",",","[","1",",","0","]","]",",","...","[","[","0",",","1","]",",","[","7",",","0","]",",","[","1",",","0","]",",","[","1",",","0","]","]",",","...","[","[","0",",","1","]",",","[","7",",","0","]",",","[","7",",","0","]",",","[","7",",","0","]","]","]","]",")",">",">",">","metric","=","ModifiedPanopticQuality","(","things","=","{","0",",","1","}",",","stuffs","=","{","6",",","7","}",")",">",">",">","metric.update","(","preds",",","target",")",">",">",">","fig_",",","ax_","=","metric.plot","(",")","..","plot",":",":",":","scale",":","75",">",">",">","#","Example","plotting","multiple","values",">",">",">","from","torch","import","tensor",">",">",">","from","torchmetrics.detection","import","ModifiedPanopticQuality",">",">",">","preds","=","tensor","(","[","[","[","[","6",",","0","]",",","[","0",",","0","]",",","[","6",",","0","]",",","[","6",",","0","]","]",",","...","[","[","0",",","0","]",",","[","0",",","0","]",",","[","6",",","0","]",",","[","0",",","1","]","]",",","...","[","[","0",",","0","]",",","[","0",",","0","]",",","[","6",",","0","]",",","[","0",",","1","]","]",",","...","[","[","0",",","0","]",",","[","7",",","0","]",",","[","6",",","0","]",",","[","1",",","0","]","]",",","...","[","[","0",",","0","]",",","[","7",",","0","]",",","[","7",",","0","]",",","[","7",",","0","]","]","]","]",")",">",">",">","target","=","tensor","(","[","[","[","[","6",",","0","]",",","[","0",",","1","]",",","[","6",",","0","]",",","[","0",",","1","]","]",",","...","[","[","0",",","1","]",",","[","0",",","1","]",",","[","6",",","0","]",",","[","0",",","1","]","]",",","...","[","[","0",",","1","]",",","[","0",",","1","]",",","[","6",",","0","]",",","[","1",",","0","]","]",",","...","[","[","0",",","1","]",",","[","7",",","0","]",",","[","1",",","0","]",",","[","1",",","0","]","]",",","...","[","[","0",",","1","]",",","[","7",",","0","]",",","[","7",",","0","]",",","[","7",",","0","]","]","]","]",")",">",">",">","metric","=","ModifiedPanopticQuality","(","things","=","{","0",",","1","}",",","stuffs","=","{","6",",","7","}",")",">",">",">","vals","=","[","]",">",">",">","for","_","in","range","(","20",")",":","...","vals.append","(","metric","(","preds",",","target",")",")",">",">",">","fig_",",","ax_","=","metric.plot","(","vals",")"]
code: def plot(
      self,
      val: Optional[Union[Tensor, Sequence[Tensor]]] = None,
      ax: Optional[_AX_TYPE] = None,
  ) -> _PLOT_OUT_TYPE:
      """Plot a single or multiple values from the metric.
  
      Args:
          val: Either a single result from calling `metric.forward` or `metric.compute` or a list of these results.
              If no value is provided, will automatically call `metric.compute` and plot that result.
          ax: An matplotlib axis object. If provided will add plot to that axis
  
      Returns:
          Figure object and Axes object
  
      Raises:
          ModuleNotFoundError:
              If `matplotlib` is not installed
  
      .. plot::
          :scale: 75
  
          >>> from torch import tensor
          >>> from torchmetrics.detection import ModifiedPanopticQuality
          >>> preds = tensor([[[[6, 0], [0, 0], [6, 0], [6, 0]],
          ...                  [[0, 0], [0, 0], [6, 0], [0, 1]],
          ...                  [[0, 0], [0, 0], [6, 0], [0, 1]],
          ...                  [[0, 0], [7, 0], [6, 0], [1, 0]],
          ...                  [[0, 0], [7, 0], [7, 0], [7, 0]]]])
          >>> target = tensor([[[[6, 0], [0, 1], [6, 0], [0, 1]],
          ...                   [[0, 1], [0, 1], [6, 0], [0, 1]],
          ...                   [[0, 1], [0, 1], [6, 0], [1, 0]],
          ...                   [[0, 1], [7, 0], [1, 0], [1, 0]],
          ...                   [[0, 1], [7, 0], [7, 0], [7, 0]]]])
          >>> metric = ModifiedPanopticQuality(things = {0, 1}, stuffs = {6, 7})
          >>> metric.update(preds, target)
          >>> fig_, ax_ = metric.plot()
  
      .. plot::
          :scale: 75
  
          >>> # Example plotting multiple values
          >>> from torch import tensor
          >>> from torchmetrics.detection import ModifiedPanopticQuality
          >>> preds = tensor([[[[6, 0], [0, 0], [6, 0], [6, 0]],
          ...                  [[0, 0], [0, 0], [6, 0], [0, 1]],
          ...                  [[0, 0], [0, 0], [6, 0], [0, 1]],
          ...                  [[0, 0], [7, 0], [6, 0], [1, 0]],
          ...                  [[0, 0], [7, 0], [7, 0], [7, 0]]]])
          >>> target = tensor([[[[6, 0], [0, 1], [6, 0], [0, 1]],
          ...                   [[0, 1], [0, 1], [6, 0], [0, 1]],
          ...                   [[0, 1], [0, 1], [6, 0], [1, 0]],
          ...                   [[0, 1], [7, 0], [1, 0], [1, 0]],
          ...                   [[0, 1], [7, 0], [7, 0], [7, 0]]]])
          >>> metric = ModifiedPanopticQuality(things = {0, 1}, stuffs = {6, 7})
          >>> vals = []
          >>> for _ in range(20):
          ...     vals.append(metric(preds, target))
          >>> fig_, ax_ = metric.plot(vals)
  
      """
      return self._plot(val, ax)
  
file_path: torchmetrics/src/torchmetrics/detection/panoptic_qualities.py
imports: from typing import Any, Collection, Optional, Sequence, Union
  import torch
  from torch import Tensor
  from torchmetrics.functional.detection._panoptic_quality_common import _get_category_id_to_continuous_id, _get_void_color, _panoptic_quality_compute, _panoptic_quality_update, _parse_categories, _prepocess_inputs, _validate_inputs
  from torchmetrics.metric import Metric
  from torchmetrics.utilities.imports import _MATPLOTLIB_AVAILABLE
  from torchmetrics.utilities.plot import _AX_TYPE, _PLOT_OUT_TYPE
label_desc: Use image node_id 4 for calling the ModifiedPanopticQuality obj's underlying member method code with example usage: obj.plot(val, ax) and returns: self