in src/data_loader.py [0:0]
def __init__(self,
root='',
year='2007',
image_set='train',
download=False,
transform=None,
target_transform=None,
shuffle=True,
perm=None,
include_eos=False):
if image_set in ['train', 'val']:
set = 'trainval'
else:
set = 'test'
VOCDetection.__init__(
self,
root=root,
year=year,
image_set=set,
download=download,
transform=transform,
target_transform=target_transform)
self.cats = [
'eos', 'aeroplane', 'bicycle', 'bird', 'boat', 'bottle', 'bus', 'car', 'cat', 'chair',
'cow', 'diningtable', 'dog', 'horse', 'motorbike', 'person', 'pottedplant', 'sheep',
'sofa', 'train', 'tvmonitor', '<pad>'
]
if perm is not None:
self.images = np.array(self.images)[perm]
self.annotations = np.array(self.annotations)[perm]
else:
self.images = np.array(self.images)
self.annotations = np.array(self.annotations)
self.include_eos = include_eos
self.shuffle = shuffle
# remove eos from category list if not needed
if not self.include_eos:
self.cats = self.cats[1:]