Ejemplo n.º 1
0
    downsample_scale=0.5,
    sampling_num=30,
    sample_res_cache='/mnt/Exp_5/AmbiguousData_pg/temp_cache.bin',
    sub_graph_nodes=24)

# set train parameters
train_params = TrainParameters()
train_params.MAX_EPOCHS = 20
train_params.START_LR = 1.0e-4
train_params.DEV_IDS = [0, 1]
train_params.LOADER_BATCH_SIZE = 1
train_params.LOADER_NUM_THREADS = 0
train_params.VALID_STEPS = 5000
train_params.MAX_VALID_BATCHES_NUM = 20
train_params.CHECKPOINT_STEPS = 6000
train_params.VERBOSE_MODE = True
train_params.NAME_TAG = 'test_gat_cluster'

box = LocalGlobalGATTrainBox(train_params=train_params,
                             ckpt_path_dict=checkpoint_dict)

train_loader = dataloader.DataLoader(train_dataset,
                                     batch_size=1,
                                     shuffle=False,
                                     pin_memory=True,
                                     drop_last=True)
itr = iter(train_loader)

i = 0
for s_itr, sample in enumerate(itr):
    img_names, meta_dict, img_lists, img_dims, Es, Cs, Ks, out_graph, sub2id, id2sub, covis_mat, e_node_idx, edge_label, e_keypt_n1, e_keypt_n2 = sample
Ejemplo n.º 2
0
                                                # large-scale graphs if GPU memory is limited

selected_topk = 50                              # select top-k for MSP

max_init_itr = 10                               # max optimization iterations for initial pose 
                                                # (forward, backward MSP using Adam)

max_final_itr = 10                              # max optimization iterations for final pose 
                                                # (forward, backward MSP + FineNet using Adam)


""" Load pre-trained model ---------------------------------------------------------------------------------------------
"""
train_params = TrainParameters()
train_params.DEV_IDS = [args.gpu_id, args.gpu_id]
train_params.VERBOSE_MODE = False
box = LocalGlobalVLADTrainBox(train_params=train_params, top_k=20, ckpt_path_dict={
    'vlad': './models/netvlad_vgg16.tar',
    'ckpt': "./models/yfcc_80nodes.pth.tar"
})
box._prepare_eval()

""" Dataset ------------------------------------------------------------------------------------------------------------
"""
test_dataset_json = args.dataset

test_dataset = make_dataset(test_dataset_json, load_img=False, load_node_edge_feat=True)
dataloader = DataLoader(test_dataset, batch_size=1, num_workers=0, shuffle=True)


""" Test Script -----------------------------------------------------------------------------------------------------------