class_docstr: Generate data for a Pascal VOC dataset.
  
  See http://host.robots.ox.ac.uk/pascal/VOC/ for more information.
class_docstr_tok: ["Generate","data","for","a","Pascal","VOC","dataset",".","See","http",":","\/\/host.robots.ox.ac.uk\/pascal\/VOC\/","for","more","information","."]
docstr: Initialize a Pascal VOC data generator.
  
  Args
      base_dir: Directory w.r.t. where the files are to be searched (defaults to the directory containing the csv_data_file).
      csv_class_file: Path to the CSV classes file.
docstr_tok: ["Initialize","a","Pascal","VOC","data","generator",".","Args","base_dir",":","Directory","w.r.t",".","where","the","files","are","to","be","searched","(","defaults","to","the","directory","containing","the","csv_data_file",")",".","csv_class_file",":","Path","to","the","CSV","classes","file","."]
code: def __init__(
      self,
      data_dir,
      set_name,
      classes=voc_classes,
      image_extension=".jpg",
      skip_truncated=False,
      skip_difficult=False,
      **kwargs,
  ):
      """Initialize a Pascal VOC data generator.
  
      Args
          base_dir: Directory w.r.t. where the files are to be searched (defaults to the directory containing the csv_data_file).
          csv_class_file: Path to the CSV classes file.
      """
      self.data_dir = data_dir
      self.set_name = set_name
      self.classes = classes
      self.image_names = [
          line.strip().split(None, 1)[0]
          for line in open(
              os.path.join(
                  data_dir, "ImageSets", "Main", set_name + ".txt"
              )
          ).readlines()
      ]
      self.image_extension = image_extension
      self.skip_truncated = skip_truncated
      self.skip_difficult = skip_difficult
  
      self.labels = {}
      for key, value in self.classes.items():
          self.labels[value] = key
  
      super(PascalVocGenerator, self).__init__(**kwargs)
  
imports: from ..preprocessing.generator import Generator
  from ..utils.image import read_image_bgr
  import os
  import numpy
  from six import raise_from
  from PIL import Image
label_desc: Use image node_id 1 to create a new PascalVocGenerator object from inherited base classes: Generator with example: obj = PascalVocGenerator(data_dir, set_name, classes, image_extension, skip_truncated, skip_difficult)