def __init__(self, root_dir, domain, transform=None): super().__init__(root_dir, domain, with_tags=True) self.transform = transform data = read_json('./data/VOC_2012.json') self.class_dic = data['class_dic'] self.classes = data['classes']
def __init__(self, root_dir, domain): super().__init__(root_dir, domain, with_id=True, with_tags=True, with_mask=True) cmap_dic, _, class_names = get_color_map_dic() self.colors = np.asarray([cmap_dic[class_name] for class_name in class_names]) data = read_json('./data/VOC_2012.json') self.class_names = np.asarray(class_names[1:21]) self.class_dic = data['class_dic'] self.classes = data['classes']
def __init__(self, root_dir, domain, path_index, label_dir, transform=None): super().__init__(root_dir, domain, with_id=True) data = read_json('./data/VOC_2012.json') self.class_dic = data['class_dic'] self.classes = data['classes'] self.transform = transform self.label_dir = label_dir self.path_index = path_index self.extract_aff_lab_func = GetAffinityLabelFromIndices(self.path_index.src_indices, self.path_index.dst_indices)
def __init__(self, json_path): data = read_json(json_path) self.class_names = ['background'] + data['class_names'] self.classes = len(self.class_names) self.clear()