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: Filter images too small or without ground truth.
  
  Returns:
      List[dict]: ``self.data_list`` after filtering.
docstr_tok: ["Filter","images","too","small","or","without","ground","truth",".","Returns",":","List","[","dict","]",":","``","self.data_list","``","after","filtering","."]
code: def filter_data(self) -> List[dict]:
      """Filter images too small or without ground truth.
  
      Returns:
          List[dict]: ``self.data_list`` after filtering.
      """
      if self.test_mode:
          return self.data_list
  
      if self.filter_cfg is None:
          return self.data_list
  
      filter_empty_gt = self.filter_cfg.get("filter_empty_gt", False)
      min_size = self.filter_cfg.get("min_size", 0)
  
      ids_with_ann = set()
      # check whether images have legal thing annotations.
      for data_info in self.data_list:
          for segment_info in data_info["segments_info"]:
              if not segment_info["is_thing"]:
                  continue
              ids_with_ann.add(data_info["img_id"])
  
      valid_data_list = []
      for data_info in self.data_list:
          img_id = data_info["img_id"]
          width = data_info["width"]
          height = data_info["height"]
          if filter_empty_gt and img_id not in ids_with_ann:
              continue
          if min(width, height) >= min_size:
              valid_data_list.append(data_info)
  
      return valid_data_list
  
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 3 for calling the CocoPanopticDataset obj's underlying member method code with example usage: obj.filter_data() and returns: valid_data_list, self, self