% : vim: set filetype=matlab :
function ROC=AUs_ROC( AUS )

    % Load the CERT output
    numAUS = size(AUS, 2);

    % load the labels and choose the right ones
    % load Subj16_AU1_all.mat;
    load labels_032.mat;

    if( numAUS == 8 )
        labels_x=LABELS(:,[1:4 6 7 8 11]); % we only need some of the labels
    elseif( numAUS == 10 )
        labels_x=LABELS(:,[1:4 6 7 8 11 12 13]); % we only need some of the labels, includes 1+2+4, 1-2
    elseif( numAUS == 11 )
        labels_x=LABELS(:,[1:11]);
    elseif( numAUS == 13 )
        labels_x=LABELS;
    elseif( numAUS == 15 )
        % Eight base AUs, 5 emotion weights, 2 MLR weights
        %AUS=AUS(:,[1:8 14 15]); % skip the emotion weights
        labels_x=LABELS(:,[1:11 12 12 13 13]); % we only need some of the labels, includes 1+2+4, 1-2
    else
        fprintf('Unknown number of labels: %d\n', numAUS );
        return;
    end

    % skip images where a face was not found
    K=setdiff(1:size(AUS,1),find(isnan(AUS(:,1))));
    ROC=ROC_area( AUS(K,:), labels_x(K,:) );    %%  only where image was found

    sprintf( '%.4f\t', ROC );
    disp(ans);
%    ROC=ROC_area( AUS, labels_x );

end
