forked from Jiaolong/dpm-octave
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo.m
49 lines (38 loc) · 798 Bytes
/
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
function demo(notcompiled)
if nargin < 1
notcompiled = false;
end
if notcompiled
compile;
fprintf('Done!\n\n');
end
load('INRIA/inriaperson_final');
model.vis = @() visualizemodel(model, ...
1:2:length(model.rules{model.start}));
test('person.jpg', model, 2);
end
function test(imname, model, num_dets)
cls = model.class;
%load and display image
im = imread(imname);
%clf;
%image(im);
%axis equal;
%axis on;
%title('input image');
disp('input image');
%disp('press any key to continue'); pause;
%disp('continuing...');
% load and display model
%model.vis();
% detect objects
tic;
[ds, bs] = imgdetect(im, model, -1);
toc;
top = nms(ds, 0.5);
top = top(1:min(length(top), num_dets));
ds = ds(top, :);
bs = bs(top, :);
clf;
showboxes(im, reduceboxes(model, bs));
end