evaluation

API details.

evaluate_Fs

 evaluate_Fs (Fs=[], subset='test')

Evaluates fundamental matrices returned by algorithm

shift_f = np.array([[0.0, 0.0, 0.0],
              [0.0, 0.0, -1.0],
              [0.0, 1.0, 0.0]])
Fs = [shift_f, shift_f]

res_dict, th = evaluate_Fs(Fs, 'val')
print (res_dict)
{'WGABS/petrzin': [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.02631579, 0.02631579, 0.02631579, 0.02631579, 0.02631579, 0.05263158, 0.05263158], 'WGALBS/kyiv_dolltheater2': [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'average': array([0.        , 0.        , 0.        , 0.        , 0.        ,
       0.        , 0.        , 0.        , 0.        , 0.        ,
       0.        , 0.        , 0.        , 0.01315789, 0.01315789,
       0.01315789, 0.01315789, 0.01315789, 0.02631579, 0.02631579],
      dtype=float32)}

evaluate_corrs

 evaluate_corrs (estimated_right=[], estimated_left=[], subset='test')

We will check the naive baseline – no camera motion, return the input baseline.

dset = WxBSDataset('.WxBS', subset='val', download=True)
predicted_left = []
predicted_right = []
for res_dict in dset:
    gt_corrs = res_dict['pts']
    query_left = gt_corrs[:, :2]
    query_right = gt_corrs[:, 2:]
    predicted_right.append(query_left)
    predicted_left.append(query_right)
eval_results = evaluate_corrs (predicted_right, predicted_left, subset='val')
print (eval_results)
({'WGABS/petrzin': array([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
       0., 0., 0.], dtype=float32), 'WGALBS/kyiv_dolltheater2': array([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
       0., 0., 0.], dtype=float32), 'average': array([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
       0., 0., 0.], dtype=float32)}, array([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16,
       17, 18, 19]))

evaluate_Hs

 evaluate_Hs (Hs=[])
dset = EVDDataset('.EVD', download=True)
predicted_Hs = []
for res_dict in dset:
    gt_H = res_dict['H']
    predicted_Hs.append(gt_H)
eval_results = evaluate_Hs (predicted_Hs)
print (eval_results)
({'adam': 0.0, 'cafe': 0.0, 'cat': 0.0, 'dum': 0.0, 'face': 0.0, 'fox': 0.0, 'girl': 0.0, 'graf': 0.0, 'grand': 0.0, 'index': 0.0, 'mag': 0.0, 'pkk': 0.0, 'shop': 0.0, 'there': 0.0, 'vin': 0.0, 'average': [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]}, array([ 1.        ,  1.39495079,  1.94588772,  2.71441762,  3.78647901,
        5.2819519 ,  7.368063  , 10.27808533, 14.33742329, 20.        ]))