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: Load annotations for an image_index.
          
docstr_tok: ["Load","annotations","for","an","image_index","."]
code: def load_annotations(self, image_index):
      """Load annotations for an image_index."""
      filename = self.image_names[image_index] + ".xml"
      try:
          tree = ET.parse(
              os.path.join(self.data_dir, "Annotations", filename)
          )
          return self.__parse_annotations(tree.getroot())
      except ET.ParseError as e:
          raise_from(
              ValueError(
                  "invalid annotations file: {}: {}".format(filename, e)
              ),
              None,
          )
      except ValueError as e:
          raise_from(
              ValueError(
                  "invalid annotations file: {}: {}".format(filename, e)
              ),
              None,
          )
  
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 13 for calling the PascalVocGenerator obj's underlying member method code with example usage: obj.load_annotations(image_index) and returns: self