]] #pick which objects to include #will be further refined by the name_to_id_map loaded later #excluded_cids = [53,76,78,79,82,86,16, 1,2,18,21,25] #excluded_cids = [53,76,78,79,82,86,16,33,32, 18,50,79,94,96] #10, 5,11,12,14] excluded_cids = [] chosen_ids = [x for x in range(0,32) if x not in excluded_cids] #val_chosen_ids = [[4,5,17,19,23],[18,50,79,94,96]] #, [5,10,17]]#chosen_ids #range(0,28)#for validation testing #val_chosen_ids = [[18,50,79,94,96,5,10,12,14,21],[5,10,12,14,21]] #, [5,10,17]]#chosen_ids #range(0,28)#for validation testing val_chosen_ids = [[1,5,9,13,17,21,25,28,29],[28,29]] #, [5,10,17]]#chosen_ids #range(0,28)#for validation testing max_difficulty = 4 #get a map from instance name to id, and back id_to_name = GetDataSet.get_class_id_to_name_dict(data_path, file_name=id_map_fname) name_to_id = {} for cid in id_to_name.keys(): name_to_id[id_to_name[cid]] = cid ##prepare target images (gather paths to the images) # target_images ={} #means to subtract from each channel of target image means = np.array([[[102.9801, 115.9465, 122.7717]]]) #path that holds dirs of all targets #i.e. target_path/target_0/* has one type of target image for each object # target_path/target_1/* has another type of target image #type of target image can mean different things,
'Gen_004_2', ] #pick which objects to include #will be further refined by the name_to_id_map loaded later #excluded_cids = [53,76,78,79,82,86,16, 1,2,18,21,25] excluded_cids = [53, 76, 78, 79, 82, 86, 16, 33, 32, 10, 5, 11, 12, 14] chosen_ids = [x for x in range(0, 111) if x not in excluded_cids] val_chosen_ids = [[4, 5, 17, 19], [ 5, 11, 12, 14 ]] #, [5,10,17]]#chosen_ids #range(0,28)#for validation testing max_difficulty = 4 #get a map from instance name to id, and back id_to_name = GetDataSet.get_class_id_to_name_dict(data_path) name_to_id = {} for cid in id_to_name.keys(): name_to_id[id_to_name[cid]] = cid ##prepare target images (gather paths to the images) # target_images = {} #means to subtract from each channel of target image means = np.array([[[102.9801, 115.9465, 122.7717]]]) #path that holds dirs of all targets #i.e. target_path/target_0/* has one type of target image for each object # target_path/target_1/* has another type of target image #type of target image can mean different things, #probably different type is different view
#pick which objects to include #will be further refined by the name_to_id_map loaded later #excluded_cids = [53,76,78,79,82,86,16, 1,2,18,21,25] #excluded_cids = [53,76,78,79,82,86,16,33,32, 1,2,18,21,25] excluded_cids = [] chosen_ids = [x for x in range(0, 32) if x not in excluded_cids] val_chosen_ids = [ chosen_ids ] # [[1,2,18,21,25]] #, [5,10,17]]#chosen_ids #range(0,28)#for validation testing max_difficulty = 4 map_fname = 'all_instance_id_map.txt' #get a map from instance name to id, and back id_to_name = GetDataSet.get_class_id_to_name_dict(data_path, file_name=map_fname) name_to_id = {} for cid in id_to_name.keys(): name_to_id[id_to_name[cid]] = cid ##prepare target images (gather paths to the images) # target_images = {} #means to subtract from each channel of target image means = np.array([[[102.9801, 115.9465, 122.7717]]]) #path that holds dirs of all targets #i.e. target_path/target_0/* has one type of target image for each object # target_path/target_1/* has another type of target image #type of target image can mean different things, #probably different type is different view
#target_path = '/net/bvisionserver3/playpen/ammirato/Data/instance_detection_targets/sygen_many_bb_similar_targets/' target_path = '/net/bvisionserver3/playpen/ammirato/Data/instance_detection_targets/AVD_BB_exact_few/' output_dir = '/net/bvisionserver3/playpen/ammirato/Data/Detections/FasterRCNN_AVD/' scene_list = [ 'Home_003_1', #'Home_003_2', #'test', #'Office_001_1' ] chosen_ids = [1] #range(28) #CREATE TRAIN/TEST splits dataset = GetDataSet.get_fasterRCNN_AVD(data_path, scene_list, preload=False, chosen_ids=chosen_ids, by_box=False, fraction_of_no_box=0) #create train/test loaders, with CUSTOM COLLATE function dataloader = torch.utils.data.DataLoader(dataset, batch_size=1, shuffle=True, collate_fn=AVD.collate) id_to_name = GetDataSet.get_class_id_to_name_dict(data_path) name_to_id = {} for cid in id_to_name.keys(): name_to_id[id_to_name[cid]] = cid target_images = get_target_images(target_path,
'Home_014_1', 'Home_014_2', 'Office_001_1' #'Home_101_1', #'Home_102_1', #'test', ] chosen_ids = [5,10,12,14,21,28]#range(28) #CREATE TRAIN/TEST splits dataset = GetDataSet.get_fasterRCNN_AVD(data_path, scene_list, preload=False, chosen_ids=chosen_ids, by_box=False, fraction_of_no_box=1, bn_normalize=use_torch_vgg) #CREATE TRAIN/TEST splits # dataset = GetDataSet.get_fasterRCNN_GMU(data_path, # scene_list, # preload=False, # chosen_ids=[6],#chosen_ids, # by_box=False, # fraction_of_no_box=0, # bn_normalize=use_torch_vgg) #