Moving to AVX instead of AVX2, compiler warning fixes. Losing dependency on OpenCV C style bindings for affine warping.

This commit is contained in:
Tadas Baltrusaitis
2018-05-07 21:54:52 +01:00
parent c376351145
commit e6849c6b52
182 changed files with 155 additions and 232 deletions

View File

@@ -2,27 +2,25 @@ clear;
addpath(genpath('../'));
output_dir = './CLM_res/';
if(~exist(output_dir, 'dir'))
mkdir(output_dir)
end
%% select database and load bb initializations
db_root = 'C:\datasets\300VW_Dataset_2015_12_14/';
db_root = 'E:\datasets\300VW\300VW_Dataset_2015_12_14/';
bb_root = './300VW_dets_mtcnn/';
extra_dir = 'C:\datasets\300VW_Dataset_2015_12_14\extra';
extra_dir = 'E:\datasets\300VW\300VW_Dataset_2015_12_14\extra';
[ vid_locs, bboxes, gts_all, invalid_frames ] = CollectTestData(db_root, bb_root, extra_dir);
%% loading the patch experts and the PDM
[ patches, pdm, clmParams ] = Load_CLM_general();
[ patches, pdm, clmParams ] = Load_CLM_wild();
% Adapt the parameters for video
clmParams.window_size = [25,25; 23,23; 21,21; 19,19; 17,17;];
clmParams.numPatchIters = size(clmParams.window_size,1);
clmParams.regFactor = [35, 27, 20, 20];
clmParams.sigmaMeanShift = [1.25, 1.375, 1.5, 1.5];
clmParams.tikhonov_factor = [0,0,0, 0];
clmParams.numPatchIters = 4;
% Defining the view orientations that will be evaluated
%views = [0,0,0];
views = [0,0,0; 0,-30,0; 0,30,0; 0,-55,0; 0,55,0; 0,0,30; 0,0,-30];
views = views * pi/180;
num_points = numel(pdm.M) / 3;
multi_view = true;
verbose = true;
%% Select video
@@ -57,34 +55,12 @@ for i=1:numel(vid_locs)
% have a multi-view version for initialization, otherwise use
% previous shape
if(reset && multi_view)
if(reset)
clmParams.window_size = [25,25; 23,23; 21,21; 21,21];
clmParams.numPatchIters = 4;
clmParams.startScale = 1;
% The number of hyps is different in CLM from CE-CLM as too
% many actually harm it
views = [0,0,0; 0,-30,0; 0,30,0; 0,-55,0; 0,55,0; 0,0,30; 0,0,-30];
views = views * pi/180;
clmParams.startScale = 1;
shapes = zeros(num_points, 2, size(views,1));
ls = zeros(size(views,1),1);
lmark_lhoods = zeros(num_points,size(views,1));
views_used = zeros(num_points,size(views,1));
g_params = cell(size(views,1),1);
l_params = cell(size(views,1),1);
% Find the best orientation
for v = 1:size(views,1)
[shapes(:,:,v),g_params{v},l_params{v},ls(v),lmark_lhoods(:,v),views_used(v)] = Fitting_from_bb(input_image, [], bb, pdm, patches, clmParams, 'orientation', views(v,:));
end
[lhood, v_ind] = max(ls);
lmark_lhood = lmark_lhoods(:,v_ind);
g_param = g_params{v_ind};
l_param = l_params{v_ind};
shape = shapes(:,:,v_ind);
view_used = views_used(v);
[shape,g_param,l_param,lhood,lmark_lhood,view_used] = Fitting_from_bb_multi_hyp(input_image, [], bb, pdm, patches, clmParams, views);
else
clmParams.window_size = [23,23; 21,21; 19,19; 17,17];