class_docstr: Pascal VOC dataset load
  
  Parameters
  ----------------
  root: str, example:'./data/VOCdevkit'.
  splits_names: tuple, ((year, trainval)).
  classes: list[str], If you using custom-voc dataset,     you need to config the name of custom objects.
  difficult: bool, False ignore voc xml difficult value.
class_docstr_tok: ["Pascal","VOC","dataset","load","Parameters","--","--","--","--","--","--","--","--","root",":","str",",","example",":","'.\/data\/VOCdevkit","'",".","splits_names",":","tuple",",","(","(","year",",","trainval",")",")",".","classes",":","list","[","str","]",",","If","you","using","custom-voc","dataset",",","you","need","to","config","the","name","of","custom","objects",".","difficult",":","bool",",","False","ignore","voc","xml","difficult","value","."]
code: def _load_label(self, idx: int) -> "ndarray":
      img_id = self._imgid_items[idx]
      anno_path = self._anno_path.format(*img_id)
      root = ET.parse(anno_path).getroot()
      width = 0
      height = 0
      size = root.find("size")
      if size is not None:
          width = int(size.find("width").text)
          height = int(size.find("height").text)
      else:
          img_path = self._image_path.format(*img_id)
          img = self._read_image(img_path)
          width, height = img.size
          self._im_cache[img_path] = img
  
      if idx not in self._im_shapes:
          # store the shapes for later usage
          self._im_shapes[idx] = (width, height)
  
      # load label [[x1, y1, x2, y2, cls, difficult]]
      label = []
      for obj in root.iter("object"):
          try:
              difficult = int(obj.find("difficult").text)
          except ValueError:
              difficult = 0
          cls_name = obj.find("name").text.strip().lower()
          if cls_name not in self.CLASSES:
              logging.warning(
                  f"{cls_name} isn't included in {self.CLASSES}"
              )
              continue
          cls_id = self.cat2label[cls_name]
          xml_box = obj.find("bndbox")
          xmin = float(int(xml_box.find("xmin").text) / width)
          ymin = float(int(xml_box.find("ymin").text) / height)
          xmax = float(int(xml_box.find("xmax").text) / width)
          ymax = float(int(xml_box.find("ymax").text) / height)
          label.append([xmin, ymin, xmax, ymax, cls_id, difficult])
      label = np.array(label).astype(np.float32)
      if not self._diff:
          label = label[..., :5]
      try:
          self._check_label(label, width, height)
      except RuntimeError as e:
          logging.warning("Invalid label at %s, %s", anno_path, e)
      return label
  
file_path: BigDL/python/orca/src/bigdl/orca/data/image/voc_dataset.py
imports: import numpy
  import os.path
  import logging
  from bigdl.dllib.utils.log4Error import invalidInputError, invalidOperationError
  from typing import TYPE_CHECKING, List, Tuple, Optional, Dict, no_type_check
label_desc: Use image node_id 6 for calling the VOCDatasets obj's underlying member method code with example usage: obj._load_label(idx) and returns: label