forked from NUS-VIP/predicting-human-gaze-beyond-pixels
-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo.m
70 lines (59 loc) · 1.52 KB
/
demo.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
% This Matlab script demonstrates the usage of this package.
%
% ----------------------------------------------------------------------
% Matlab tools for "Predicting human gaze beyond pixels," Journal of Vision, 2014
% Juan Xu, Ming Jiang, Shuo Wang, Mohan Kankanhalli, Qi Zhao
%
% Copyright (c) 2014 NUS VIP - Visual Information Processing Lab
%
% Distributed under the MIT License
% See LICENSE file in the distribution folder.
% -----------------------------------------------------------------------
fprintf('Setting up the environment.\n');
tic;
addpath(genpath('src'));
% initialize GBVS
cd lib/gbvs
gbvs_install
cd ../..
% initialize liblinear
addpath('lib/liblinear');
cd lib/liblinear
make
cd ../..
toc;
% load parameters
p = config;
fprintf('Computing fixation maps.\n');
tic;
computeFixationMaps(p);
toc;
fprintf('Computing Itti & Koch saliency maps.\n');
tic;
computeIttiMaps(p);
toc;
fprintf('Computing object-level feature maps.\n');
tic;
extractObjectFeatures(p);
computeObjectMaps(p);
toc;
fprintf('Computing semantic-level feature maps.\n');
tic;
computeSemanticMaps(p);
toc;
fprintf('Computing ideal (inter-subject) AUC scores.\n');
tic;
computeInterSubjectAUC(p);
toc;
% train and evaluate the saliency model with an n-fold cross validation
fprintf('Training and testing linear SVM model.\n');
tic;
splitData(p);
auc = cell(1, p.ml.nSplit);
curves = cell(1, p.ml.nSplit);
for split = 1:p.ml.nSplit
trainModel(p, split);
computeSaliencyMaps(p, split);
[auc{split}, curves{split}] = normalizedAUC(p, split);
end
toc;