-
Notifications
You must be signed in to change notification settings - Fork 93
Expand file tree
/
Copy pathcompute_abo_candidates.m
More file actions
50 lines (42 loc) · 1.62 KB
/
compute_abo_candidates.m
File metadata and controls
50 lines (42 loc) · 1.62 KB
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
48
49
function compute_abo_candidates(testset, config)
num_images = numel(testset.impos);
candidates_thresholds = round(10 .^ (0:0.5:4))
num_candidates_thresholds = numel(candidates_thresholds);
proposalNames = fieldnames(config);
proposalsToEvaluate=proposalNames(3:end-1);
for i = 1:length(proposalsToEvaluate)
method = config.(char(proposalsToEvaluate{i}));
candidate_dir=[config.outputLocation '/' proposalsToEvaluate{i}];
fileName=[ candidate_dir '/' 'abo_candidates.mat'];
try
method=config.(char(proposalsToEvaluate(i)))
load(fileName, 'abo_candidates');
continue;
catch
abo_candidates = [];
abo_candidates(num_candidates_thresholds).candidates_threshold = [];
abo_candidates(num_candidates_thresholds).candidates = [];
for i = 1:num_candidates_thresholds
abo_candidates(i).candidates_threshold = candidates_thresholds(i);
abo_candidates(i).candidates = cell(num_images, 1);
end
for i=1:num_images
img_id =testset.impos(i).im;
for j=1:num_candidates_thresholds
[candidates, scores] = get_candidates(candidate_dir, method, img_id, candidates_thresholds(j), true);
abo_candidates(j).candidates{i}=candidates;
end
r=rem(i,1000);
if(r==0)
fprintf('done with image :%s,%s\n',img_id,char(method.opts.name));
end
end
parsave(fileName, abo_candidates);
end
end
end
function parsave(fileName, data)
var_name=genvarname(inputname(2));
eval([var_name '=data'])
save(fileName,var_name,'-v7.3');
end