2017-01-04 22:32:38 +00:00
|
|
|
function [output_dir] = run_bu_experiment(bu_dir, verbose, varargin)
|
2016-04-28 19:40:36 +00:00
|
|
|
|
2017-01-04 22:32:38 +00:00
|
|
|
if(isunix)
|
|
|
|
executable = '"../../build/bin/FeatureExtraction"';
|
|
|
|
else
|
|
|
|
executable = '"../../x64/Release/FeatureExtraction.exe"';
|
2016-04-28 19:40:36 +00:00
|
|
|
end
|
|
|
|
|
2017-01-04 22:32:38 +00:00
|
|
|
output_dir = 'experiments/bu_out/';
|
|
|
|
|
2016-04-28 19:40:36 +00:00
|
|
|
buFiles = dir([bu_dir '*.avi']);
|
|
|
|
|
|
|
|
numTogether = 25;
|
|
|
|
|
|
|
|
for i=1:numTogether:numel(buFiles)
|
|
|
|
|
|
|
|
command = executable;
|
2017-01-04 22:32:38 +00:00
|
|
|
command = cat(2, command, [' -inroot ' '"' bu_dir '/"']);
|
2016-04-28 19:40:36 +00:00
|
|
|
|
|
|
|
% BU dataset orientation is in terms of camera plane, instruct the
|
|
|
|
% tracker to output it in that format
|
|
|
|
command = cat(2, command, [' -cp ']);
|
|
|
|
|
|
|
|
% deal with edge cases
|
|
|
|
if(numTogether + i > numel(buFiles))
|
|
|
|
numTogether = numel(buFiles) - i + 1;
|
|
|
|
end
|
|
|
|
|
|
|
|
for n=0:numTogether-1
|
|
|
|
inputFile = [buFiles(n+i).name];
|
|
|
|
[~, name, ~] = fileparts(inputFile);
|
|
|
|
|
|
|
|
% where to output results
|
2017-01-04 22:32:38 +00:00
|
|
|
outputFile = [output_dir name '.txt'];
|
2016-04-28 19:40:36 +00:00
|
|
|
|
|
|
|
command = cat(2, command, [' -f "' inputFile '" -of "' outputFile '"']);
|
|
|
|
|
|
|
|
if(verbose)
|
2017-01-04 22:32:38 +00:00
|
|
|
outputVideo = ['"' output_dir name '.avi' '"'];
|
2016-04-28 19:40:36 +00:00
|
|
|
command = cat(2, command, [' -ov ' outputVideo]);
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2017-10-14 20:26:04 +00:00
|
|
|
command = cat(2, command, ' -fx 500 -fy 500 -cx 160 -cy 120 -no2Dfp -no3Dfp -noMparams -noAUs -noGaze -vis-track ');
|
2016-04-28 19:40:36 +00:00
|
|
|
|
|
|
|
if(any(strcmp('model', varargin)))
|
|
|
|
command = cat(2, command, [' -mloc "', varargin{find(strcmp('model', varargin))+1}, '"']);
|
|
|
|
end
|
|
|
|
|
2017-01-04 22:32:38 +00:00
|
|
|
if(isunix)
|
|
|
|
unix(command, '-echo')
|
|
|
|
else
|
|
|
|
dos(command);
|
|
|
|
end
|
2016-04-28 19:40:36 +00:00
|
|
|
end
|
2017-01-04 22:32:38 +00:00
|
|
|
|
2016-04-28 19:40:36 +00:00
|
|
|
end
|