blob: 5687592442d48495e2957280d1c6379ffdd75785 [file] [log] [blame]
import numpy as np
class Imdb(object):
"""
Base class for dataset loading
Parameters:
----------
name : str
name of dataset
"""
def __init__(self, name):
self.name = name
self.classes = []
self.num_classes = 0
self.image_set_index = []
self.num_images = 0
self.labels = None
self.padding = 0
def image_path_from_index(self, index):
"""
load image full path given specified index
Parameters:
----------
index : int
index of image requested in dataset
Returns:
----------
full path of specified image
"""
raise NotImplementedError
def label_from_index(self, index):
"""
load ground-truth of image given specified index
Parameters:
----------
index : int
index of image requested in dataset
Returns:
----------
object ground-truths, in format
numpy.array([id, xmin, ymin, xmax, ymax]...)
"""
raise NotImplementedError