class_docstr: Load dataset with PascalVOC format.
  
  Notes:
  `anno_path` must contains xml file and image file path for annotations.
  
  Args:
      dataset_dir (str): root directory for dataset.
      image_dir (str): directory for images.
      anno_path (str): voc 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.
      label_list (str): if use_default_label is False, will load
          mapping between category and class index.
      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.
class_docstr_tok: ["Load","dataset","with","PascalVOC","format",".","Notes",":","`","anno_path","`","must","contains","xml","file","and","image","file","path","for","annotations",".","Args",":","dataset_dir","(","str",")",":","root","directory","for","dataset",".","image_dir","(","str",")",":","directory","for","images",".","anno_path","(","str",")",":","voc","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",".","label_list","(","str",")",":","if","use_default_label","is","False",",","will","load","mapping","between","category","and","class","index",".","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,
      label_list=None,
      allow_empty=False,
      empty_ratio=1.0,
      repeat=1,
  ):
      super(VOCDataSet, self).__init__(
          dataset_dir=dataset_dir,
          image_dir=image_dir,
          anno_path=anno_path,
          data_fields=data_fields,
          sample_num=sample_num,
          repeat=repeat,
      )
      self.label_list = label_list
      self.allow_empty = allow_empty
      self.empty_ratio = empty_ratio
  
file_path: PaddleDetection/ppdet/data/source/voc.py
imports: import os
  import numpy
  import xml.etree.ElementTree
  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 VOCDataSet object from inherited base classes: DetDataset with example: obj = VOCDataSet(dataset_dir, image_dir, anno_path, data_fields, sample_num, label_list, allow_empty, empty_ratio, repeat)