sustaining_gazes/gui/OpenFaceOffline/confirm_gui_output.m

55 lines
1.9 KiB
Mathematica
Raw Normal View History

2018-01-29 17:57:50 +01:00
addpath('../../matlab_runners/Demos');
2018-01-31 18:49:29 +01:00
root1 = "C:\Users\Tadas Baltrusaitis\Documents\OpenFace-GUI\x64\Release\processed";
root2 = "C:\Users\Tadas Baltrusaitis\Documents\OpenFace\x64\Release\processed";
gui_files = dir(sprintf('%s/*.csv', root1));
for i = 1:numel(gui_files)
2018-01-29 17:57:50 +01:00
table_gui = readtable(sprintf('%s/%s', root1, gui_files(i).name));
table_console = readtable(sprintf('%s/%s', root2, gui_files(i).name));
var_names = table_console.Properties.VariableNames;
for v =1:numel(var_names)
feat_gui = table_gui{:,var_names(v)};
feat_console = table_console{:,var_names(v)};
feat_diff = norm(abs(feat_gui - feat_console));
if(feat_diff > 0.1)
fprintf('%s error - %.3f\n', var_names{v}, feat_diff);
end
end
2018-01-29 17:57:50 +01:00
% Compare the HOG file
[~,name,~] = fileparts(gui_files(i).name);
[hog_gui, valid_gui] = Read_HOG_file(sprintf('%s/%s.hog', root1, name));
[hog_console, valid_console] = Read_HOG_file(sprintf('%s/%s.hog', root2, name));
feat_diff = norm(abs(hog_gui(:) - hog_console(:)));
if(feat_diff > 0.1)
fprintf('%s error - %.3f\n', var_names{v}, feat_diff);
end
feat_diff = norm(abs(valid_gui - valid_console));
if(feat_diff > 0.1)
fprintf('%s error - %.3f\n', var_names{v}, feat_diff);
end
% Compare the simalign ones
gui_aligns = dir(sprintf('%s/%s_aligned/*.bmp', root1, name));
2018-01-31 18:49:29 +01:00
console_aligns = dir(sprintf('%s/%s_aligned/*.bmp', root2, name));
2018-01-29 17:57:50 +01:00
for j=1:numel(gui_aligns)
gui_align = imread(sprintf('%s/%s_aligned/%s', root1, name, gui_aligns(j).name));
2018-01-31 18:49:29 +01:00
console_align = imread(sprintf('%s/%s_aligned/%s', root2, name, console_aligns(j).name));
2018-01-29 17:57:50 +01:00
feat_diff = norm(abs(double(gui_align(:)) - double(console_align(:))));
if(feat_diff > 0.1)
fprintf('%s error - %.3f\n', var_names{v}, feat_diff);
end
end
end