-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathdemo_MODEC.m
More file actions
30 lines (26 loc) · 925 Bytes
/
demo_MODEC.m
File metadata and controls
30 lines (26 loc) · 925 Bytes
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
%% setup
startup;
close all;
imgfile = 'example.jpg';
model = loadvar('MODEC-model.mat','mdls');
% slower, better model:
% model = loadvar('MODEC-model-full.mat','mdls');
load cluster_info.mat
%% detect a torso
img = imread(imgfile);
[bounds_predictions,poselet_hits,torso_predictions] = poselets_lite_detect(img);
% take top scoring torso only:
torso = rect2box(torso_predictions.bounds(:,1)');
%% run pose estimator on most confident torso
pred = run_modec(model, img, torso);
%% display results
figure(1)
cla, imagesc(img), hold on, axis image
plotbox(torso,'w:')
myplot(pred.coords(:,lookupPart('lsho','lelb','lwri')),'go-','linewidth',3)
myplot(pred.coords(:,lookupPart('rsho','relb','rwri')),'bo-','linewidth',3)
%% display the top 5 right-side modes, sorted by inference score
figure(2), clf
[~,order_right] = sort(pred.mode_scores(:,2),'descend');
imagesc([cluster_info.thumbs{order_right(1:5)}]);
axis image off