class_docstr: Generate data for a custom CSV dataset.
  
  See https://github.com/fizyr/keras-retinanet#csv-datasets for more information.
class_docstr_tok: ["Generate","data","for","a","custom","CSV","dataset",".","See","https",":","\/\/github.com\/fizyr\/keras-retinanet","#","csv-datasets","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."""
      path = self.image_names[image_index]
      annotations = {
          "labels": np.empty((0,)),
          "bboxes": np.empty((0, 4)),
      }
  
      for idx, annot in enumerate(self.image_data[path]):
          annotations["labels"] = np.concatenate(
              (
                  annotations["labels"],
                  [self.name_to_label(annot["class"])],
              )
          )
          annotations["bboxes"] = np.concatenate(
              (
                  annotations["bboxes"],
                  [
                      [
                          float(annot["x1"]),
                          float(annot["y1"]),
                          float(annot["x2"]),
                          float(annot["y2"]),
                      ]
                  ],
              )
          )
  
      return annotations
  
imports: from .generator import Generator
  from ..utils.image import read_image_bgr
  import numpy
  from PIL import Image
  from six import raise_from
  import csv
  import sys
  import os.path
  from collections import OrderedDict
label_desc: Use image node_id 11 for calling the CSVGenerator obj's underlying member method code with example usage: obj.load_annotations(image_index) and returns: annotations