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: Parse an annotation given an XML element.
          
docstr_tok: ["Parse","an","annotation","given","an","XML","element","."]
code: def __parse_annotation(self, element):
      """Parse an annotation given an XML element."""
      truncated = _findNode(element, "truncated", parse=int)
      difficult = _findNode(element, "difficult", parse=int)
  
      class_name = _findNode(element, "name").text
      if class_name not in self.classes:
          raise ValueError(
              "class name '{}' not found in classes: {}".format(
                  class_name, list(self.classes.keys())
              )
          )
  
      box = np.zeros((4,))
      label = self.name_to_label(class_name)
  
      bndbox = _findNode(element, "bndbox")
      box[0] = _findNode(bndbox, "xmin", "bndbox.xmin", parse=float) - 1
      box[1] = _findNode(bndbox, "ymin", "bndbox.ymin", parse=float) - 1
      box[2] = _findNode(bndbox, "xmax", "bndbox.xmax", parse=float) - 1
      box[3] = _findNode(bndbox, "ymax", "bndbox.ymax", parse=float) - 1
  
      return truncated, difficult, box, label
  
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 11 for calling the PascalVocGenerator obj's underlying member method code with example usage: obj.__parse_annotation(element) and returns: truncated,  difficult,  box,  label