-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathRecallGeo.m
47 lines (25 loc) · 806 Bytes
/
RecallGeo.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
clear all;
close all;
clc;
desc_path = 'PUT YOUR DESCRIPTOR PATH HERE!!!!!!!!!!!';
desc = load(desc_path)
load('../OriNet_CVACT/CVACT_orientations/ACT_data.mat');
sat_desc = single(desc.sat_global_descriptor);
grd_desc = single(desc.grd_global_descriptor);
% knn search
topk = 200;
sat_desc = sat_desc';
grd_desc = grd_desc';
nb_images = size(sat_desc,2);
recalls_5 = zeros(nb_images, topk);
utms_val = utm(valSetAll.valInd,:);
parfor i = 1:nb_images
[ids, dis]= yael_nn(sat_desc, grd_desc(:,i),topk);
cur_utm = utms_val(i,:);
retrived_utm = utms_val(ids,:);
L2_dis = cur_utm - retrived_utm;
L2_dis = sqrt(L2_dis(:,1).^2 + L2_dis(:,2).^2);
df = L2_dis <=5;
recalls_5(i,:) = cumsum(df');
end
mean_recalls_5 = mean(logical(recalls_5),1);