sustaining_gazes/matlab_runners/Action Unit Experiments/helpers/extract_FERA2011_labels.m
Tadas Baltrusaitis 2128589309 A lot of changes:
- New AU recognition models trained on extra datasets - Bosphorus, UNBC, FERA2011
- Cleaner and clearer separation of static and dynamic AU models
- AU training code cleaned up and instructions added
- bug fixes with median feature computation
- AU prediction correction (smoothing and shifting) with post processing
2016-07-22 09:35:50 -04:00

45 lines
1.1 KiB
Matlab

function [ labels, valid_ids, filenames ] = extract_FERA2011_labels( FERA2011_dir, recs, aus )
%EXTRACT_SEMAINE_LABELS Summary of this function goes here
% Detailed explanation goes here
num_files = numel(recs);
% speech invalidates lower face AUs
labels = cell(num_files, 1);
valid_ids = cell(num_files, 1);
filenames = cell(num_files, 1);
file_id = 1;
for i=1:numel(recs)
file = [FERA2011_dir, '/', recs{i}, '/', recs{i}, '-au.dat'];
[~, filename,~] = fileparts(file);
filenames{file_id} = filename;
data = csvread(file); %import annotations for one video file
speech = data(:,end);
labels{file_id} = data(:, aus);
% Finding the invalid regions
if(aus(1) >= 10)
valid = speech == 0;
else
valid = true(size(speech,1), 1);
end
% all indices in SEMAINE are valid
valid_ids{file_id} = valid;
file_id = file_id + 1;
end
labels = labels(1:file_id-1);
valid_ids = valid_ids(1:file_id-1);
filenames = filenames(1:file_id-1);
end