code: def _get_color_areas(inputs: Tensor) -> Dict[Tuple, Tensor]:
      """Measure the size of each instance.
  
      Args:
          inputs: the input tensor containing the colored pixels.
  
      Returns:
          A dictionary specifying the `(category_id, instance_id)` and the corresponding number of occurrences.
  
      """
      unique_keys, unique_keys_area = torch.unique(
          inputs, dim=0, return_counts=True
      )
      # dictionary indexed by color tuples
      return dict(zip(_to_tuple(unique_keys), unique_keys_area))
  
file_path: torchmetrics/src/torchmetrics/functional/detection/_panoptic_quality_common.py
imports: from typing import Collection, Dict, Iterator, List, Optional, Set, Tuple, cast
  import torch
  from torch import Tensor
  from torchmetrics.utilities import rank_zero_warn
label_desc: Use image node_id 3 for calling a global function with example usage: _get_color_areas(inputs) and returns: dict