2016-04-28 19:40:36 +00:00
|
|
|
clear;
|
|
|
|
|
|
|
|
% fitting parameters more suitable for clnf
|
|
|
|
|
|
|
|
%%
|
|
|
|
% Run the BU test with clnf
|
|
|
|
if exist('D:/Datasets/HeadPose', 'file')
|
|
|
|
database_root = 'D:/Datasets/HeadPose/';
|
|
|
|
elseif(exist([getenv('USERPROFILE') '/Dropbox/AAM/test data/'], 'file'))
|
|
|
|
database_root = [getenv('USERPROFILE') '/Dropbox/AAM/test data/'];
|
2017-01-04 22:32:38 +00:00
|
|
|
elseif(exist([getenv('USERPROFILE') 'F:/Dropbox/Dropbox/AAM/test data/'], 'file'))
|
2016-04-28 19:40:36 +00:00
|
|
|
database_root = 'F:/Dropbox/Dropbox/AAM/test data/';
|
2017-09-11 07:03:29 +00:00
|
|
|
elseif(exist('F:/Dropbox/AAM/test data/', 'file'))
|
|
|
|
database_root = 'F:/Dropbox/AAM/test data/';
|
2017-12-28 17:41:25 +00:00
|
|
|
elseif(exist('/multicomp/datasets/head_pose_dbs', 'file'))
|
2017-01-04 22:32:38 +00:00
|
|
|
database_root = '/multicomp/datasets/head_pose_dbs/';
|
2017-12-28 17:41:25 +00:00
|
|
|
elseif(exist('/media/tadas/5E08AE0D08ADE3ED/Dropbox/AAM/test data', 'file'))
|
|
|
|
database_root = '/media/tadas/5E08AE0D08ADE3ED/Dropbox/AAM/test data';
|
2016-04-28 19:40:36 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
buDir = [database_root, '/bu/uniform-light/'];
|
|
|
|
|
|
|
|
% The fast and accurate clnf
|
|
|
|
%%
|
2017-01-04 22:32:38 +00:00
|
|
|
[resFolderBU_OF] = run_bu_experiment(buDir, false, 'model', 'model/main_clnf_general.txt');
|
2016-04-28 19:40:36 +00:00
|
|
|
[bu_error_OF, pred_hp_bu, gt_hp_bu, all_errors_bu_OF, rels_bu] = calcBUerror(resFolderBU_OF, buDir);
|
|
|
|
|
|
|
|
%%
|
|
|
|
% Run the Biwi test
|
|
|
|
biwi_dir = '/biwi pose/';
|
|
|
|
|
2017-10-21 11:15:22 +00:00
|
|
|
[res_folder_biwi_OF] = run_biwi_experiment(database_root, biwi_dir, false, 'model', 'model/main_clnf_general.txt');
|
2016-04-28 19:40:36 +00:00
|
|
|
% Calculate the resulting errors
|
2017-01-04 22:32:38 +00:00
|
|
|
[biwi_error_OF, pred_hp_biwi, gt_hp_biwi, ~, all_errors_biwi_OF, rels_biwi] = calcBiwiError(res_folder_biwi_OF, [database_root biwi_dir]);
|
2016-04-28 19:40:36 +00:00
|
|
|
|
|
|
|
%% Run the ICT test
|
2017-01-04 22:32:38 +00:00
|
|
|
ict_dir = ['/ict/'];
|
2016-04-28 19:40:36 +00:00
|
|
|
|
|
|
|
% Intensity
|
2017-10-21 11:15:22 +00:00
|
|
|
[res_folder_ict_OF] = run_ict_experiment(database_root, ict_dir, false, 'model', 'model/main_clnf_general.txt');
|
2016-04-28 19:40:36 +00:00
|
|
|
% Calculate the resulting errors
|
2017-01-04 22:32:38 +00:00
|
|
|
[ict_error_OF, pred_hp_ict, gt_hp_ict, ~, all_errors_ict_OF, rel_ict] = calcIctError(res_folder_ict_OF, [database_root ict_dir]);
|
2016-04-28 19:40:36 +00:00
|
|
|
|
|
|
|
%% Save the results
|
|
|
|
filename = 'results/Pose_OF';
|
|
|
|
save(filename);
|
|
|
|
|
|
|
|
% Also save them in a reasonable .txt format for easy comparison
|
|
|
|
f = fopen('results/Pose_OF.txt', 'w');
|
|
|
|
fprintf(f, 'Dataset and model, pitch, yaw, roll, mean, median\n');
|
|
|
|
fprintf(f, 'biwi error: %.3f, %.3f, %.3f, %.3f, %.3f\n', biwi_error_OF, mean(all_errors_biwi_OF(:)), median(all_errors_biwi_OF(:)));
|
|
|
|
fprintf(f, 'bu error: %.3f, %.3f, %.3f, %.3f, %.3f\n', bu_error_OF, mean(all_errors_bu_OF(:)), median(all_errors_bu_OF(:)));
|
|
|
|
fprintf(f, 'ict error: %.3f, %.3f, %.3f, %.3f, %.3f\n', ict_error_OF, mean(all_errors_ict_OF(:)), median(all_errors_ict_OF(:)));
|
|
|
|
|
|
|
|
fclose(f);
|
|
|
|
clear 'f'
|