class_docstr: Load dataset with COCO format.
  
  Args:
      dataset_dir (str): root directory for dataset.
      image_dir (str): directory for images.
      anno_path (str): coco annotation file path.
      data_fields (list): key name of data dictionary, at least have 'image'.
      sample_num (int): number of samples to load, -1 means all.
      load_crowd (bool): whether to load crowded ground-truth. 
          False as default
      allow_empty (bool): whether to load empty entry. False as default
      empty_ratio (float): the ratio of empty record number to total 
          record's, if empty_ratio is out of [0. ,1.), do not sample the 
          records and use all the empty entries. 1. as default
      repeat (int): repeat times for dataset, use in benchmark.
code: def __init__(
      self,
      dataset_dir=None,
      image_dir=None,
      anno_path=None,
      data_fields=["image"],
      sample_num=-1,
      load_crowd=False,
      allow_empty=False,
      empty_ratio=1.0,
      repeat=1,
  ):
      super(COCODataSet, self).__init__(
          dataset_dir,
          image_dir,
          anno_path,
          data_fields,
          sample_num,
          repeat=repeat,
      )
      self.load_image_only = False
      self.load_semantic = False
      self.load_crowd = load_crowd
      self.allow_empty = allow_empty
      self.empty_ratio = empty_ratio
  
imports: import os
  import copy
  import numpy
  from ppdet.core.workspace import register, serializable
  from .dataset import DetDataset
  from ppdet.utils.logger import setup_logger
label_desc: Use image node_id 1 to create a new COCODataSet object from inherited base classes: DetDataset with example: obj = COCODataSet(dataset_dir, image_dir, anno_path, data_fields, sample_num, load_crowd, allow_empty, empty_ratio, repeat)