docstr: Filter images too small or without ground truths.
docstr_tok: ["Filter","images","too","small","or","without","ground","truths","."]
code: def _filter_imgs(self, min_size=32):
      """Filter images too small or without ground truths."""
      valid_inds = []
      # obtain images that contain annotation
      ids_with_ann = set(_["image_id"] for _ in self.coco.anns.values())
      # obtain images that contain annotations of the required categories
      ids_in_cat = set()
      for i, class_id in enumerate(self.cat_ids):
          ids_in_cat |= set(self.coco.cat_img_map[class_id])
      # merge the image id sets of the two conditions and use the merged set
      # to filter out images if self.filter_empty_gt=True
      ids_in_cat &= ids_with_ann
  
      valid_img_ids = []
      for i, img_info in enumerate(self.data_infos):
          img_id = self.img_ids[i]
          if self.filter_empty_gt and img_id not in ids_in_cat:
              continue
          if min(img_info["width"], img_info["height"]) >= min_size:
              valid_inds.append(i)
              valid_img_ids.append(img_id)
      self.img_ids = valid_img_ids
      return valid_inds
  
imports: import itertools
  import logging
  import os.path
  import tempfile
  from collections import OrderedDict
  import mmcv
  import numpy
  from mmcv.utils import print_log
  from pycocotools.coco import COCO
  from pycocotools.cocoeval import COCOeval
  from terminaltables import AsciiTable
  from mmdet.core import eval_recalls
  from .builder import DATASETS
  from .custom import CustomDataset
label_desc: Use image node_id 4 for calling the CocoDataset obj's underlying member method code with example usage: obj._filter_imgs(min_size) and returns: valid_inds