Exemplo n.º 1
0
                                                batch_size=opt.cacheBatchSize,
                                                shuffle=False,
                                                pin_memory=cuda)

        train_set = dataset.get_training_query_set(opt.margin)

        print('====> Training query set:', len(train_set))
        whole_test_set = dataset.get_whole_val_set()
        print('===> Evaluating on val set, query count:',
              whole_test_set.dbStruct.numQ)
    elif opt.mode.lower() == 'test':
        if opt.split.lower() == 'test':
            whole_test_set = dataset.get_whole_test_set()
            print('===> Evaluating on test set')
        elif opt.split.lower() == 'test250k':
            whole_test_set = dataset.get_250k_test_set()
            print('===> Evaluating on test250k set')
        elif opt.split.lower() == 'train':
            whole_test_set = dataset.get_whole_training_set()
            print('===> Evaluating on train set')
        elif opt.split.lower() == 'val':
            whole_test_set = dataset.get_whole_val_set()
            print('===> Evaluating on val set')
        else:
            raise ValueError('Unknown dataset split: ' + opt.split)
        print('====> Query count:', whole_test_set.dbStruct.numQ)
    elif opt.mode.lower() == 'cluster':
        whole_train_set = dataset.get_whole_training_set(onlyDB=True)

    print('===> Building model')
Exemplo n.º 2
0
            opt.arch.lower(), opt.margin)

        print('====> Training query set:', len(train_set_list[0]))
        whole_test_set = dataset.get_whole_val_set(opt.arch.lower())
        print('===> Evaluating on val set, query count:',
              whole_test_set.dbStruct.numQ)
    elif opt.mode.lower() == 'test':
        if opt.split.lower() == 'test':
            whole_test_set = dataset.get_whole_test_set(opt.arch.lower())
            print('===> Evaluating on test set')
        elif opt.split.lower() == 'test_hard':
            whole_test_set = dataset.get_test_hard_set(opt.arch.lower())
            print('===> Evaluating on test hard')
        elif opt.split.lower() == 'test250k':
            if opt.dataset.lower() == 'pittsburgh':
                whole_test_set = dataset.get_250k_test_set(opt.arch.lower())
                print('===> Evaluating on test250k set')
            else:
                raise Exception(str(opt.dataset) + ' has no test250k set')
        elif opt.split.lower() == 'train':
            whole_test_set = dataset.get_whole_training_set(opt.arch.lower())
            print('===> Evaluating on train set')
        elif opt.split.lower() == 'val':
            whole_test_set = dataset.get_whole_val_set(opt.arch.lower())
            print('===> Evaluating on val set')
        else:
            raise ValueError('Unknown dataset split: ' + opt.split)
        print('====> Query count:', whole_test_set.dbStruct.numQ)
    elif opt.mode.lower() == 'cluster':
        whole_train_set = dataset.get_whole_training_set(opt.arch.lower(),
                                                         onlyDB=False)[0]