class_docstr: Load detection dataset.
  
  Args:
      dataset_dir (str): root directory for dataset.
      image_dir (str): directory for images.
      anno_path (str): 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.
      use_default_label (bool): whether to load default label list.
      repeat (int): repeat times for dataset, use in benchmark.
class_docstr_tok: ["Load","detection","dataset",".","Args",":","dataset_dir","(","str",")",":","root","directory","for","dataset",".","image_dir","(","str",")",":","directory","for","images",".","anno_path","(","str",")",":","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",".","use_default_label","(","bool",")",":","whether","to","load","default","label","list",".","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,
      use_default_label=None,
      repeat=1,
      **kwargs,
  ):
      super(DetDataset, self).__init__()
      self.dataset_dir = dataset_dir if dataset_dir is not None else ""
      self.anno_path = anno_path
      self.image_dir = image_dir if image_dir is not None else ""
      self.data_fields = data_fields
      self.sample_num = sample_num
      self.use_default_label = use_default_label
      self.repeat = repeat
      self._epoch = 0
      self._curr_iter = 0
  
imports: import os
  import copy
  import numpy
  from paddle.io import Dataset
  from ppdet.core.workspace import register, serializable
  from ppdet.utils.download import get_dataset_path
  from ppdet.data import source
  from ppdet.utils.logger import setup_logger
label_desc: Use image node_id 1 to create a new DetDataset object from inherited base classes: Dataset with example: obj = DetDataset(dataset_dir, image_dir, anno_path, data_fields, sample_num, use_default_label, repeat)