Some more Menpo fixes.

This commit is contained in:
Tadas Baltrusaitis
2017-02-17 17:50:13 -05:00
parent b94b32ea7f
commit 986382ef18
2 changed files with 12 additions and 5 deletions

View File

@@ -1,5 +1,5 @@
clear
load('menpo_68_pts.mat');
load('menpo_68_pts_valid.mat');
xs = all_pts(1:end/2,:);
ys = all_pts(end/2+1:end,:);
@@ -16,7 +16,7 @@ pdm = struct;
pdm.M = double(M);
pdm.E = double(E);
pdm.V = double(V);
errs_poss = [];
for i=1:num_imgs
@@ -28,7 +28,8 @@ for i=1:num_imgs
rots(:,i) = Rot2Euler(R);
if(errs(i) < 0 || errs(i) > 4)
a = 2;
fprintf('i - %d, err - %.3f\n', i, errs(i));
errs_poss = cat(1, errs_poss, i);
end
end

View File

@@ -16,17 +16,23 @@ right_to_frontal_map = [17,28; 18,29; 19,30; 20,31;
35,63; 36,64; 37,65; 38,66; 39,67];
all_pts = [];
ps = [248 523 604 800 840 901 938 944 947 1383 1413 1533 1562 1637 1770 2164 2400 2688 2775 2838 2849];
for i=1:numel(dataset_locs)
landmarkLabels = dir([dataset_locs{i} '\*.pts']);
landmarkImgs = dir([dataset_locs{i} '\*.jpg']);
for p=1:numel(landmarkLabels)
% for p=604:numel(landmarkLabels)
for p=ps
landmarks = importdata([dataset_locs{i}, landmarkLabels(p).name], ' ', 3);
img = imread([dataset_locs{i}, landmarkImgs(p).name]);
landmarks = landmarks.data;
landmark_labels = -ones(68,2);
% Problem with the labels
if(strcmp(landmarkImgs(p).name, 'aflw__face_43770.jpg'))
landmarks(13:16,:) = landmarks(16:-1:13,:);
end
% Problem with the labels
if(strcmp(landmarkImgs(p).name, 'aflw__face_63080.jpg'))
landmarks(1:12,:) = landmarks(12:-1:1,:);
landmarks(13:16,:) = landmarks(16:-1:13,:);