Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, image_set, nthu_path=None):
datasets.imdb.__init__(self, 'nthu_' + image_set)
self._image_set = image_set
self._nthu_path = self._get_default_path() if nthu_path is None \
else nthu_path
self._data_path = os.path.join(self._nthu_path, 'data')
self._classes = ('__background__', 'Car', 'Pedestrian', 'Cyclist')
self._class_to_ind = dict(zip(self.classes, xrange(self.num_classes)))
self._image_ext = '.jpg'
self._image_index = self._load_image_set_index()
# Default to roidb handler
if cfg.IS_RPN:
self._roidb_handler = self.gt_roidb
else:
self._roidb_handler = self.region_proposal_roidb
# num of subclasses
self._num_subclasses = 227 + 36 + 36 + 1
def __init__(self, image_set, shapenet_single_path = None):
datasets.imdb.__init__(self, 'shapenet_single_' + image_set)
self._image_set = image_set
self._shapenet_single_path = self._get_default_path() if shapenet_single_path is None \
else shapenet_single_path
self._data_path = os.path.join(self._shapenet_single_path, 'data')
self._classes = ('__background__', 'bowl')
self._class_colors = [(0, 0, 0), (255, 0, 0)]
self._class_weights = [1, 1]
self._class_to_ind = dict(zip(self.classes, xrange(self.num_classes)))
self._image_ext = '.png'
self._image_index = self._load_image_set_index()
self._roidb_handler = self.gt_roidb
self._extents = self._load_object_extents()
assert os.path.exists(self._shapenet_single_path), \
'shapenet_single path does not exist: {}'.format(self._shapenet_single_path)
def __init__(self, image_set, ycb_path = None):
datasets.imdb.__init__(self, 'ycb_' + image_set)
self._image_set = image_set
self._ycb_path = self._get_default_path() if ycb_path is None \
else ycb_path
self._data_path = os.path.join(self._ycb_path, 'data')
self._classes = ('__background__', '002_master_chef_can', '003_cracker_box', '004_sugar_box', '005_tomato_soup_can', '006_mustard_bottle', \
'007_tuna_fish_can', '008_pudding_box', '009_gelatin_box', '010_potted_meat_can', '011_banana', '019_pitcher_base', \
'021_bleach_cleanser', '024_bowl', '025_mug', '035_power_drill', '036_wood_block', '037_scissors', '040_large_marker', \
'051_large_clamp', '052_extra_large_clamp', '061_foam_brick')
self._class_colors = [(255, 255, 255), (255, 0, 0), (0, 255, 0), (0, 0, 255), (255, 255, 0), (255, 0, 255), (0, 255, 255), \
(128, 0, 0), (0, 128, 0), (0, 0, 128), (128, 128, 0), (128, 0, 128), (0, 128, 128), \
(64, 0, 0), (0, 64, 0), (0, 0, 64), (64, 64, 0), (64, 0, 64), (0, 64, 64),
(192, 0, 0), (0, 192, 0), (0, 0, 192)]
self._class_weights = [1, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100]
def __init__(self, image_set, year, devkit_path=None):
datasets.imdb.__init__(self, 'voc_' + year + '_' + image_set)
self._year = year
self._image_set = image_set
self._devkit_path = self._get_default_path() if devkit_path is None \
else devkit_path
#self._data_path = os.path.join(self._devkit_path, 'VOC' + self._year)
self._data_path = datasets.DATA_DIR
self._classes = ('__background__', # always index 0
'aeroplane', 'bicycle', 'bird', 'boat',
'bottle', 'bus', 'car', 'cat', 'chair',
'cow', 'diningtable', 'dog', 'horse',
'motorbike', 'person', 'pottedplant',
'sheep', 'sofa', 'train', 'tvmonitor')
self._class_to_ind = dict(zip(self.classes, xrange(self.num_classes)))
self._image_ext = '.jpg'
self._image_index = self._load_image_set_index()
# Default to roidb handler
def __init__(self, image_set, shapenet_scene_path = None):
datasets.imdb.__init__(self, 'shapenet_scene_' + image_set)
self._image_set = image_set
self._shapenet_scene_path = self._get_default_path() if shapenet_scene_path is None \
else shapenet_scene_path
self._data_path = os.path.join(self._shapenet_scene_path, 'data')
self._classes = ('__background__', 'table', 'tvmonitor', 'bottle', 'mug', 'can', 'keyboard', 'cap')
self._class_colors = [(0, 0, 0), (255, 0, 0), (0, 255, 0), (0, 0, 255), (255, 255, 0), (255, 0, 255), (0, 255, 255), (188, 0, 0)]
self._class_weights = [1, 1, 1, 1, 1, 1, 1, 1]
self._class_to_ind = dict(zip(self.classes, xrange(self.num_classes)))
self._image_ext = '.png'
self._image_index = self._load_image_set_index()
self._roidb_handler = self.gt_roidb
assert os.path.exists(self._shapenet_scene_path), \
'shapenet_scene path does not exist: {}'.format(self._shapenet_scene_path)
assert os.path.exists(self._data_path), \
'Data path does not exist: {}'.format(self._data_path)
def __init__(self, image_set, year, devkit_path=None, image_type = 'images'):
datasets.imdb.__init__(self, 'nyud2_' + image_type + '_' + year + '_' + image_set)
self._year = year
self._devkit_path = self._get_default_path() if devkit_path is None \
else devkit_path
self._data_path = os.path.join(self._devkit_path, 'data')
self._classes = ('__background__', # always index 0
'bathtub', 'bed', 'bookshelf', 'box', 'chair', 'counter', 'desk',
'door', 'dresser', 'garbage-bin', 'lamp', 'monitor', 'night-stand',
'pillow', 'sink', 'sofa', 'table', 'television', 'toilet');
self._class_to_ind = dict(zip(self.classes, xrange(self.num_classes)))
self._image_type = image_type;
self._image_set = image_set;
self._image_ext = '.png'
self._image_index = self._load_image_set_index()
# Default to roidb handler
def __init__(self, image_set, kitti_path=None):
datasets.imdb.__init__(self, 'kitti_' + image_set)
self._image_set = image_set
self._kitti_path = self._get_default_path() if kitti_path is None \
else kitti_path
self._data_path = os.path.join(self._kitti_path, 'data_object_image_2')
self._classes = ('__background__', 'Car', 'Pedestrian', 'Cyclist')
self._class_to_ind = dict(zip(self.classes, xrange(self.num_classes)))
self._image_ext = '.png'
self._image_index = self._load_image_set_index()
# Default to roidb handler
if cfg.IS_RPN:
self._roidb_handler = self.gt_roidb
else:
self._roidb_handler = self.region_proposal_roidb
# num of subclasses
if image_set == 'train' or image_set == 'val':
def __init__(self, image_set, year, devkit_path=None):
datasets.imdb.__init__(self, 'voc_' + year + '_' + image_set)
self._year = year
self._image_set = image_set
self._devkit_path = self._get_default_path() if devkit_path is None \
else devkit_path
self._data_path = os.path.join(self._devkit_path, 'VOC' + self._year)
self._classes = ('__background__', # always index 0
'aeroplane', 'bicycle', 'bird', 'boat',
'bottle', 'bus', 'car', 'cat', 'chair',
'cow', 'diningtable', 'dog', 'horse',
'motorbike', 'person', 'pottedplant',
'sheep', 'sofa', 'train', 'tvmonitor')
self._class_to_ind = dict(zip(self.classes, xrange(self.num_classes)))
self._image_ext = '.jpg'
self._image_index = self._load_image_set_index()
# Default to roidb handler
self._roidb_handler = self.casrpn_roidb