-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathevaluate_boc.m
43 lines (30 loc) · 963 Bytes
/
evaluate_boc.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
% compute score for the BOC approach
config_boc;
options
mycfg = 'holidays';
if strcmp (mycfg, 'holidays')
cfg = config_holidays;
nimg = cfg.n;
else
error ('Unknow database');
end
knn = 500;
% Comparison metric
seldis = 1;
if length (strfind (options, 'L1dis')) > 0
seldis = 1;
elseif length (strfind (options, 'L2dis')) > 0
seldis = 2;
end
bocfile = [cfg.dir_data 'boc/k' num2str(kcol) '_' colorspace '_sz' num2str(cfg.ppmsize) '.mat'];
% Load the signatures from disk
load (bocfile, 'Hall');
% Compute BOC from histogram. We could use directly Xall instead, but here we save
% some time when testing different options in config_boc.m
X = single(boc_from_histo (Hall, options) );
%
[idx, dis] = yael_nn (X, X(:,cfg.qidx), knn, seldis);
[map, tpranks1] = compute_results (idx, cfg.gnd, false);
fprintf ('kcol=%4d mAP=%.4f clip=%d idf=%d\n', kcol, map, ...
length(strfind(options,'clip'))>0, ...
length(strfind(options,'idf'))>0);