diff --git a/matlab_runners/Action Unit Experiments/results/BP4D_valid_res_class.txt b/matlab_runners/Action Unit Experiments/results/BP4D_valid_res_class.txt index 6f597fa..47205c9 100644 --- a/matlab_runners/Action Unit Experiments/results/BP4D_valid_res_class.txt +++ b/matlab_runners/Action Unit Experiments/results/BP4D_valid_res_class.txt @@ -1,5 +1,5 @@ AU1 class, Precision - 0.555, Recall - 0.533, F1 - 0.544 -AU2 class, Precision - 0.403, Recall - 0.440, F1 - 0.420 +AU2 class, Precision - 0.403, Recall - 0.439, F1 - 0.420 AU4 class, Precision - 0.491, Recall - 0.513, F1 - 0.502 AU6 class, Precision - 0.741, Recall - 0.776, F1 - 0.758 AU7 class, Precision - 0.764, Recall - 0.727, F1 - 0.745 diff --git a/matlab_runners/Action Unit Experiments/run_AU_prediction_BP4D.m b/matlab_runners/Action Unit Experiments/run_AU_prediction_BP4D.m index 86e05d3..2471b41 100644 --- a/matlab_runners/Action Unit Experiments/run_AU_prediction_BP4D.m +++ b/matlab_runners/Action Unit Experiments/run_AU_prediction_BP4D.m @@ -4,10 +4,6 @@ find_BP4D; BP4D_dir = [BP4D_dir, '../BP4D-training/']; out_loc = './out_bp4d/'; -if(~exist(out_loc, 'dir')) - mkdir(out_loc); -end - %% executable = '"../../x64/Release/FeatureExtraction.exe"'; @@ -23,7 +19,7 @@ new_bp4d_dirs = {}; for i = 1:numel(bp4d_dirs) dirs = dir([BP4D_dir, '/', bp4d_dirs{i}, '/T*']); - tmp_dir = [BP4D_dir, '/../tmp/', bp4d_dirs{i}, '/']; + tmp_dir = [BP4D_dir, '/../tmp/', bp4d_dirs{i}]; new_bp4d_dirs = cat(1, new_bp4d_dirs, tmp_dir); if(~exist(tmp_dir, 'file')) @@ -51,16 +47,9 @@ for i = 1:numel(bp4d_dirs) end %% -parfor f1=1:numel(new_bp4d_dirs) +for f1=1:numel(new_bp4d_dirs) - command = [executable ' -asvid -no2Dfp -no3Dfp -noMparams -noPose -noGaze ']; - - [f,~,~] = fileparts(new_bp4d_dirs{f1}); - [~,f,~] = fileparts(f); - output_file = [out_loc f '.au.txt']; - - command = cat(2, command, [' -fdir "' new_bp4d_dirs{f1} '" -of "' output_file '"']); - + command = sprintf('%s -aus -fdir "%s" -out_dir "%s"', executable, new_bp4d_dirs{f1}, out_loc); dos(command); end @@ -76,7 +65,7 @@ aus_BP4D = [1, 2, 4, 6, 7, 10, 12, 14, 15, 17, 23]; labels_gt = cat(1, labels_gt{:}); %% Identifying which column IDs correspond to which AU -tab = readtable([out_loc, bp4d_dirs{1}, '.au.txt']); +tab = readtable([out_loc, bp4d_dirs{1}, '.csv']); column_names = tab.Properties.VariableNames; % As there are both classes and intensities list and evaluate both of them @@ -110,10 +99,9 @@ preds_all_class = []; for i=1:numel(new_bp4d_dirs) - [f,~,~] = fileparts(new_bp4d_dirs{i}); - [~,f,~] = fileparts(f); + [~,f,~] = fileparts(new_bp4d_dirs{i}); - fname = [out_loc, f, '.au.txt']; + fname = [out_loc, f, '.csv']; preds = dlmread(fname, ',', 1, 0); @@ -157,7 +145,7 @@ valid_ids = cat(1, valid_ids{:}); labels_gt = cat(1, labels_gt{:}); %% Identifying which column IDs correspond to which AU -tab = readtable([out_loc, bp4d_dirs{1}, '.au.txt']); +tab = readtable([out_loc, bp4d_dirs{1}, '.csv']); column_names = tab.Properties.VariableNames; % As there are both classes and intensities list and evaluate both of them @@ -184,10 +172,9 @@ preds_all_int = []; for i=1:numel(new_bp4d_dirs) - [f,~,~] = fileparts(new_bp4d_dirs{i}); - [~,f,~] = fileparts(f); - - fname = [out_loc, f, '.au.txt']; + [~,f,~] = fileparts(new_bp4d_dirs{i}); + + fname = [out_loc, f, '.csv']; preds = dlmread(fname, ',', 1, 0); % Read all of the intensity AUs