for vci in val_chosen_ids:
    vci = list(set(set(vci) & set(name_to_id.values())))
for cid in chosen_ids:
    if cid == 0:
        continue
    if ((len(target_images[id_to_name[cid]]) < 1) or 
            (len(target_images[id_to_name[cid]][0])) < 1):
        print('Missing target images for {}!'.format(id_to_name[cid]))
        sys.exit()

#CREATE TRAIN/TEST splits
train_set = GetDataSet.get_fasterRCNN_AVD(data_path,
                                          train_list,
                                          #test_list,
                                          max_difficulty=max_difficulty,
                                          chosen_ids=chosen_ids,
                                          by_box=False,
                                          fraction_of_no_box=0.1,
                                          bn_normalize=use_torch_vgg,
                                          to_tensor=False)

#create train/test loaders, with CUSTOM COLLATE function
trainloader = torch.utils.data.DataLoader(train_set,
                                          batch_size=batch_size,
                                          shuffle=True,
                                          collate_fn=AVD.collate)




Пример #2
0
chosen_ids = list(set(set(chosen_ids) & set(name_to_id.values())))
for vci in val_chosen_ids:
    vci = list(set(set(vci) & set(name_to_id.values())))
for cid in chosen_ids:
    if cid == 0:
        continue
    if ((len(target_images[id_to_name[cid]]) < 1)
            or (len(target_images[id_to_name[cid]][0])) < 1):
        print('Missing target images for {}!'.format(id_to_name[cid]))
        sys.exit()

#CREATE TRAIN/TEST splits
train_set = GetDataSet.get_fasterRCNN_AVD(
    data_path,
    train_list,
    #test_list,
    max_difficulty=max_difficulty,
    chosen_ids=chosen_ids,
    by_box=False,
    fraction_of_no_box=0.02)

#create train/test loaders, with CUSTOM COLLATE function
trainloader = torch.utils.data.DataLoader(train_set,
                                          batch_size=1,
                                          shuffle=True,
                                          collate_fn=AVD.collate)

print chosen_ids

#load net definition and init parameters
net = TDID()
if load_trained_model:
Пример #3
0
    #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,
Пример #4
0
             '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)
#