docstr: Parse bbox and mask annotation.
  
  Args:
      img_info (dict): Image info of an image.
      ann_info (list[dict]): Annotation info of an image.
  
  Returns:
      dict: A dict containing the following keys: bboxes,                 bboxes_ignore, labels, masks, seg_map.                 "masks" are already decoded into binary masks.
docstr_tok: ["Parse","bbox","and","mask","annotation",".","Args",":","img_info","(","dict",")",":","Image","info","of","an","image",".","ann_info","(","list","[","dict","]",")",":","Annotation","info","of","an","image",".","Returns",":","dict",":","A","dict","containing","the","following","keys",":","bboxes",",","bboxes_ignore",",","labels",",","masks",",","seg_map",".","``","masks","''","are","already","decoded","into","binary","masks","."]
code: def _parse_ann_info(self, img_info, ann_info):
      """Parse bbox and mask annotation.
  
          Args:
              img_info (dict): Image info of an image.
              ann_info (list[dict]): Annotation info of an image.
  
          Returns:
              dict: A dict containing the following keys: bboxes, \
                  bboxes_ignore, labels, masks, seg_map. \
                  "masks" are already decoded into binary masks.
          """
      gt_bboxes = []
      gt_labels = []
      gt_bboxes_ignore = []
      gt_masks_ann = []
  
      for i, ann in enumerate(ann_info):
          if ann.get("ignore", False):
              continue
          x1, y1, w, h = ann["bbox"]
          if ann["area"] <= 0 or w < 1 or h < 1:
              continue
          if ann["category_id"] not in self.cat_ids:
              continue
          bbox = [x1, y1, x1 + w, y1 + h]
          if ann.get("iscrowd", False):
              gt_bboxes_ignore.append(bbox)
          else:
              gt_bboxes.append(bbox)
              gt_labels.append(self.cat2label[ann["category_id"]])
              gt_masks_ann.append(ann["segmentation"])
  
      if gt_bboxes:
          gt_bboxes = np.array(gt_bboxes, dtype=np.float32)
          gt_labels = np.array(gt_labels, dtype=np.int64)
      else:
          gt_bboxes = np.zeros((0, 4), dtype=np.float32)
          gt_labels = np.array([], dtype=np.int64)
  
      if gt_bboxes_ignore:
          gt_bboxes_ignore = np.array(
              gt_bboxes_ignore, dtype=np.float32
          )
      else:
          gt_bboxes_ignore = np.zeros((0, 4), dtype=np.float32)
  
      ann = dict(
          bboxes=gt_bboxes,
          labels=gt_labels,
          bboxes_ignore=gt_bboxes_ignore,
          masks=gt_masks_ann,
          seg_map=img_info["segm_file"],
      )
  
      return ann
  
file_path: insightface/detection/scrfd/mmdet/datasets/cityscapes.py
imports: import glob
  import os
  import os.path
  import tempfile
  from collections import OrderedDict
  import mmcv
  import numpy
  import pycocotools.mask
  from mmcv.utils import print_log
  from .builder import DATASETS
  from .coco import CocoDataset
label_desc: Use image node_id 2 for calling the CityscapesDataset obj's underlying member method code with example usage: obj._parse_ann_info(img_info, ann_info) and returns: ann