def image_aspect_ratio(self, image_index):
        """ Compute the aspect ratio for an image with image_index.
        """
        # PIL is fast for metadata
        image = Image.open(self.image_path(image_index))
        return float(image.width) / float(image.height)
 Compute the aspect ratio for an image with image_index.
        
keras_retinanet/preprocessing/csv_generator.py