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 all annotations under the xml_root.
          
docstr_tok: ["Parse","all","annotations","under","the","xml_root","."]
code: def __parse_annotations(self, xml_root):
      """Parse all annotations under the xml_root."""
      annotations = {
          "labels": np.empty((len(xml_root.findall("object")),)),
          "bboxes": np.empty((len(xml_root.findall("object")), 4)),
      }
      for i, element in enumerate(xml_root.iter("object")):
          try:
              (
                  truncated,
                  difficult,
                  box,
                  label,
              ) = self.__parse_annotation(element)
          except ValueError as e:
              raise_from(
                  ValueError(
                      "could not parse object #{}: {}".format(i, e)
                  ),
                  None,
              )
  
          if truncated and self.skip_truncated:
              continue
          if difficult and self.skip_difficult:
              continue
  
          annotations["bboxes"][i, :] = box
          annotations["labels"][i] = label
  
      return annotations
  
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 12 for calling the PascalVocGenerator obj's underlying member method code with example usage: obj.__parse_annotations(xml_root) and returns: annotations