class_docstr: Coco dataset for Panoptic segmentation.
  
  The annotation format is shown as follows. The `ann` field is optional
  for testing.
  
  .. code-block:: none
  
      [
          {
              'filename': f'{image_id:012}.png',
              'image_id':9
              'segments_info':
              [
                  {
                      'id': 8345037, (segment_id in panoptic png,
                                      convert from rgb)
                      'category_id': 51,
                      'iscrowd': 0,
                      'bbox': (x1, y1, w, h),
                      'area': 24315
                  },
                  ...
              ]
          },
          ...
      ]
  
  Args:
      ann_file (str): Annotation file path. Defaults to ''.
      metainfo (dict, optional): Meta information for dataset, such as class
          information. Defaults to None.
      data_root (str, optional): The root directory for ``data_prefix`` and
          ``ann_file``. Defaults to None.
      data_prefix (dict, optional): Prefix for training data. Defaults to
          ``dict(img=None, ann=None, seg=None)``. The prefix ``seg`` which is
          for panoptic segmentation map must be not None.
      filter_cfg (dict, optional): Config for filter data. Defaults to None.
      indices (int or Sequence[int], optional): Support using first few
          data in annotation file to facilitate training/testing on a smaller
          dataset. Defaults to None which means using all ``data_infos``.
      serialize_data (bool, optional): Whether to hold memory using
          serialized objects, when enabled, data loader workers can use
          shared RAM from master process instead of making a copy. Defaults
          to True.
      pipeline (list, optional): Processing pipeline. Defaults to [].
      test_mode (bool, optional): ``test_mode=True`` means in test phase.
          Defaults to False.
      lazy_init (bool, optional): Whether to load annotation during
          instantiation. In some cases, such as visualization, only the meta
          information of the dataset is needed, which is not necessary to
          load annotation file. ``Basedataset`` can skip load annotations to
          save time by set ``lazy_init=False``. Defaults to False.
      max_refetch (int, optional): If ``Basedataset.prepare_data`` get a
          None img. The maximum extra number of cycles to get a valid
          image. Defaults to 1000.
docstr: Parse raw annotation to target format.
  
  Args:
      raw_data_info (dict): Raw data information load from ``ann_file``.
  
  Returns:
      dict: Parsed annotation.
docstr_tok: ["Parse","raw","annotation","to","target","format",".","Args",":","raw_data_info","(","dict",")",":","Raw","data","information","load","from","``","ann_file","``",".","Returns",":","dict",":","Parsed","annotation","."]
code: def parse_data_info(self, raw_data_info: dict) -> dict:
      """Parse raw annotation to target format.
  
      Args:
          raw_data_info (dict): Raw data information load from ``ann_file``.
  
      Returns:
          dict: Parsed annotation.
      """
      img_info = raw_data_info["raw_img_info"]
      ann_info = raw_data_info["raw_ann_info"]
      # filter out unmatched annotations which have
      # same segment_id but belong to other image
      ann_info = [
          ann
          for ann in ann_info
          if ann["image_id"] == img_info["img_id"]
      ]
      data_info = {}
  
      img_path = osp.join(
          self.data_prefix["img"], img_info["file_name"]
      )
      if self.data_prefix.get("seg", None):
          seg_map_path = osp.join(
              self.data_prefix["seg"],
              img_info["file_name"].replace(".jpg", ".png"),
          )
      else:
          seg_map_path = None
      data_info["img_path"] = img_path
      data_info["img_id"] = img_info["img_id"]
      data_info["seg_map_path"] = seg_map_path
      data_info["height"] = img_info["height"]
      data_info["width"] = img_info["width"]
  
      if self.return_classes:
          data_info["text"] = self.metainfo["thing_classes"]
          data_info["stuff_text"] = self.metainfo["stuff_classes"]
          data_info["custom_entities"] = True  # no important
  
      instances = []
      segments_info = []
      for ann in ann_info:
          instance = {}
          x1, y1, w, h = ann["bbox"]
          if ann["area"] <= 0 or w < 1 or h < 1:
              continue
          bbox = [x1, y1, x1 + w, y1 + h]
          category_id = ann["category_id"]
          contiguous_cat_id = self.cat2label[category_id]
  
          is_thing = self.coco.load_cats(ids=category_id)[0]["isthing"]
          if is_thing:
              is_crowd = ann.get("iscrowd", False)
              instance["bbox"] = bbox
              instance["bbox_label"] = contiguous_cat_id
              if not is_crowd:
                  instance["ignore_flag"] = 0
              else:
                  instance["ignore_flag"] = 1
                  is_thing = False
  
          segment_info = {
              "id": ann["id"],
              "category": contiguous_cat_id,
              "is_thing": is_thing,
          }
          segments_info.append(segment_info)
          if len(instance) > 0 and is_thing:
              instances.append(instance)
      data_info["instances"] = instances
      data_info["segments_info"] = segments_info
      return data_info
  
file_path: mmdetection/mmdet/datasets/coco_panoptic.py
imports: import os.path
  from typing import Callable, List, Optional, Sequence, Union
  from mmdet.registry import DATASETS
  from .api_wrappers import COCOPanoptic
  from .coco import CocoDataset
label_desc: Use image node_id 2 for calling the CocoPanopticDataset obj's underlying member method code with example usage: obj.parse_data_info(raw_data_info) and returns: data_info