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: Compute panoptic quality based on inputs passed in to ``update`` previously.
docstr_tok: ["Compute","panoptic","quality","based","on","inputs","passed","in","to","``","update","``","previously","."]
code: def compute(self) -> Tensor:
      """Compute panoptic quality based on inputs passed in to ``update`` previously."""
      return _panoptic_quality_compute(
          self.iou_sum,
          self.true_positives,
          self.false_positives,
          self.false_negatives,
      )
  
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 3 for calling the ModifiedPanopticQuality obj's underlying member method code with example usage: obj.compute() and returns: _panoptic_quality_compute