2017-01-04 23:32:38 +01:00
|
|
|
clear
|
|
|
|
|
|
|
|
if(isunix)
|
|
|
|
executable = '"../../build/bin/FaceLandmarkVid"';
|
|
|
|
else
|
|
|
|
executable = '"../../x64/Release/FaceLandmarkVid.exe"';
|
|
|
|
end
|
2016-04-28 21:40:36 +02:00
|
|
|
|
|
|
|
output = './demo_vid/';
|
|
|
|
|
|
|
|
if(~exist(output, 'file'))
|
|
|
|
mkdir(output)
|
|
|
|
end
|
|
|
|
|
2017-05-09 03:36:23 +02:00
|
|
|
in_files = dir('../../samples/*.wmv');
|
|
|
|
in_files = cat(1, in_files, dir('../../samples/*.avi'));
|
2016-04-28 21:40:36 +02:00
|
|
|
% some parameters
|
|
|
|
verbose = true;
|
|
|
|
|
|
|
|
% Trained on in the wild and multi-pie data (less accurate SVR/CLM model)
|
|
|
|
%model = 'model/main_clm_general.txt';
|
|
|
|
% Trained on in-the-wild
|
|
|
|
%model = 'model/main_clm_wild.txt';
|
|
|
|
|
|
|
|
% Trained on in the wild and multi-pie data (more accurate CLNF model)
|
|
|
|
model = 'model/main_clnf_general.txt';
|
|
|
|
% Trained on in-the-wild
|
|
|
|
%model = 'model/main_clnf_wild.txt';
|
|
|
|
|
2016-07-31 22:31:17 +02:00
|
|
|
command = executable;
|
2016-04-28 21:40:36 +02:00
|
|
|
command = cat(2, command, [' -mloc "', model, '"']);
|
|
|
|
% add all videos to single argument list (so as not to load the model anew
|
|
|
|
% for every video)
|
|
|
|
for i=1:numel(in_files)
|
|
|
|
|
2017-05-09 03:36:23 +02:00
|
|
|
inputFile = ['../../samples/', in_files(i).name];
|
2016-04-28 21:40:36 +02:00
|
|
|
[~, name, ~] = fileparts(inputFile);
|
|
|
|
|
|
|
|
command = cat(2, command, [' -f "' inputFile '" ']);
|
|
|
|
|
|
|
|
if(verbose)
|
|
|
|
outputVideo = ['"' output name '.avi' '"'];
|
|
|
|
command = cat(2, command, [' -ov ' outputVideo]);
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
2017-01-04 23:32:38 +01:00
|
|
|
if(isunix)
|
|
|
|
unix(command);
|
|
|
|
else
|
|
|
|
dos(command);
|
|
|
|
end
|