mirror of
https://gitcode.com/gh_mirrors/ope/OpenFace.git
synced 2026-05-15 11:47:50 +00:00
Moving to AVX instead of AVX2, compiler warning fixes. Losing dependency on OpenCV C style bindings for affine warping.
This commit is contained in:
@@ -8,40 +8,19 @@ if(~exist(output_dir, 'dir'))
|
||||
end
|
||||
|
||||
%% select database and load bb initializations
|
||||
db_root = 'D:\Datasets\300VW_Dataset_2015_12_14\300VW_Dataset_2015_12_14/';
|
||||
db_root = 'E:\datasets\300VW\300VW_Dataset_2015_12_14/';
|
||||
bb_root = './300VW_dets_mtcnn/';
|
||||
extra_dir = 'D:\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
|
||||
clmParams = struct;
|
||||
|
||||
clmParams.window_size = [25,25; 23,23; 21,21; 19,19; 17,17;];
|
||||
clmParams.numPatchIters = size(clmParams.window_size,1);
|
||||
[ patches, pdm, clmParams ] = Load_CLNF_general();
|
||||
views = [0,0,0; 0,-30,0; 0,30,0; 0,-55,0; 0,55,0; 0,0,30; 0,0,-30; 0,-90,0; 0,90,0; 0,-70,40; 0,70,-40];
|
||||
views = views * pi/180;
|
||||
|
||||
[patches] = Load_Patch_Experts( '../models/general/', 'ccnf_patches_*_general.mat', [], [], clmParams);
|
||||
|
||||
% the default PDM to use
|
||||
pdmLoc = ['../models/pdm/pdm_68_aligned_wild.mat'];
|
||||
|
||||
load(pdmLoc);
|
||||
|
||||
pdm = struct; pdm.M = double(M); pdm.E = double(E); pdm.V = double(V);
|
||||
num_points = numel(pdm.M) / 3;
|
||||
|
||||
clmParams.regFactor = [35, 27, 20, 20];
|
||||
clmParams.sigmaMeanShift = [1.25, 1.375, 1.5, 1.5];
|
||||
clmParams.tikhonov_factor = [0,0,0,0];
|
||||
|
||||
clmParams.startScale = 1;
|
||||
clmParams.num_RLMS_iter = 10;
|
||||
clmParams.fTol = 0.01;
|
||||
clmParams.useMultiScale = true;
|
||||
clmParams.use_multi_modal = 1;
|
||||
clmParams.multi_modal_types = patches(1).multi_modal_types;
|
||||
clmParams.numPatchIters = 4;
|
||||
|
||||
multi_view = true;
|
||||
verbose = true;
|
||||
|
||||
%% Select video
|
||||
@@ -76,32 +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;
|
||||
|
||||
views = [0,0,0; 0,-30,0; 0,30,0; 0,-55,0; 0,55,0; 0,0,30; 0,0,-30; 0,-90,0; 0,90,0; 0,-70,40; 0,70,-40];
|
||||
views = views * pi/180;
|
||||
|
||||
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];
|
||||
|
||||
Reference in New Issue
Block a user