From 986382ef18c5bb0eb680b3cfda081c4eb33b2840 Mon Sep 17 00:00:00 2001 From: Tadas Baltrusaitis Date: Fri, 17 Feb 2017 17:50:13 -0500 Subject: [PATCH] Some more Menpo fixes. --- .../menpo_pdm/Analyze_orient_distribution.m | 7 ++++--- .../menpo_pdm/Collect_menpo_annotations_valid.m | 10 ++++++++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/matlab_version/pdm_generation/menpo_pdm/Analyze_orient_distribution.m b/matlab_version/pdm_generation/menpo_pdm/Analyze_orient_distribution.m index 710d7a83..6a3a7756 100644 --- a/matlab_version/pdm_generation/menpo_pdm/Analyze_orient_distribution.m +++ b/matlab_version/pdm_generation/menpo_pdm/Analyze_orient_distribution.m @@ -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 diff --git a/matlab_version/pdm_generation/menpo_pdm/Collect_menpo_annotations_valid.m b/matlab_version/pdm_generation/menpo_pdm/Collect_menpo_annotations_valid.m index b171465d..2c5d14f8 100644 --- a/matlab_version/pdm_generation/menpo_pdm/Collect_menpo_annotations_valid.m +++ b/matlab_version/pdm_generation/menpo_pdm/Collect_menpo_annotations_valid.m @@ -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,:);