class_docstr: Generate data from the COCO dataset.
  
  See https://github.com/cocodataset/cocoapi/tree/master/PythonAPI for more information.
docstr: Initialize a COCO data generator.
  
  Args
      data_dir: Path to where the COCO dataset is stored.
      set_name: Name of the set to parse.
docstr_tok: ["Initialize","a","COCO","data","generator",".","Args","data_dir",":","Path","to","where","the","COCO","dataset","is","stored",".","set_name",":","Name","of","the","set","to","parse","."]
code: def __init__(self, data_dir, set_name, **kwargs):
      """Initialize a COCO data generator.
  
      Args
          data_dir: Path to where the COCO dataset is stored.
          set_name: Name of the set to parse.
      """
      self.data_dir = data_dir
      self.set_name = set_name
      self.coco = COCO(
          os.path.join(
              data_dir, "annotations", "instances_" + set_name + ".json"
          )
      )
      self.image_ids = self.coco.getImgIds()
  
      self.load_classes()
  
      super(CocoGenerator, self).__init__(**kwargs)
  
imports: from ..preprocessing.generator import Generator
  from ..utils.image import read_image_bgr
  import os
  import numpy
  from pycocotools.coco import COCO
label_desc: Use image node_id 1 to create a new CocoGenerator object from inherited base classes: Generator with example: obj = CocoGenerator(data_dir, set_name)