docstr: Args:
      add_gt: whether to add ground truth bounding box annotations to the dicts
      add_mask: whether to also add ground truth mask
  
  Returns:
      a list of dict, each has keys including:
          'image_id', 'file_name',
          and (if add_gt is True) 'boxes', 'class', 'is_crowd', and optionally
          'segmentation'.
docstr_tok: ["Args",":","add_gt",":","whether","to","add","ground","truth","bounding","box","annotations","to","the","dicts","add_mask",":","whether","to","also","add","ground","truth","mask","Returns",":","a","list","of","dict",",","each","has","keys","including",":","'image_id","'",",","'file_name","'",",","and","(","if","add_gt","is","True",")","'boxes","'",",","'class","'",",","'is_crowd","'",",","and","optionally","'segmentation","'","."]
code: def load(self, add_gt=True, add_mask=False):
      """
      Args:
          add_gt: whether to add ground truth bounding box annotations to the dicts
          add_mask: whether to also add ground truth mask
  
      Returns:
          a list of dict, each has keys including:
              'image_id', 'file_name',
              and (if add_gt is True) 'boxes', 'class', 'is_crowd', and optionally
              'segmentation'.
      """
      with timed_operation(
          "Load annotations for {}".format(
              os.path.basename(self.annotation_file)
          )
      ):
          img_ids = self.coco.getImgIds()
          img_ids.sort()
          # list of dict, each has keys: height,width,id,file_name
          imgs = self.coco.loadImgs(img_ids)
  
          for idx, img in enumerate(tqdm.tqdm(imgs)):
              img["image_id"] = img.pop("id")
              img["file_name"] = os.path.join(
                  self._imgdir, img["file_name"]
              )
              if idx == 0:
                  # make sure the directories are correctly set
                  assert os.path.isfile(img["file_name"]), img[
                      "file_name"
                  ]
              if add_gt:
                  self._add_detection_gt(img, add_mask)
          return imgs
  
file_path: tensorpack/examples/FasterRCNN/dataset/coco.py
imports: import json
  import numpy
  import os
  import tqdm
  from tensorpack.utils import logger
  from tensorpack.utils.timer import timed_operation
  from config import config
  from dataset import DatasetRegistry, DatasetSplit
label_desc: Use image node_id 3 for calling the COCODetection obj's underlying member method code with example usage: obj.load(add_gt, add_mask) and returns: imgs