2017-11-05 10:30:40 +00:00
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
// Copyright (C) 2017, Tadas Baltrusaitis, all rights reserved.
|
|
|
|
|
//
|
|
|
|
|
// ACADEMIC OR NON-PROFIT ORGANIZATION NONCOMMERCIAL RESEARCH USE ONLY
|
|
|
|
|
//
|
|
|
|
|
// BY USING OR DOWNLOADING THE SOFTWARE, YOU ARE AGREEING TO THE TERMS OF THIS LICENSE AGREEMENT.
|
|
|
|
|
// IF YOU DO NOT AGREE WITH THESE TERMS, YOU MAY NOT USE OR DOWNLOAD THE SOFTWARE.
|
|
|
|
|
//
|
|
|
|
|
// License can be found in OpenFace-license.txt
|
|
|
|
|
//
|
|
|
|
|
// * Any publications arising from the use of this software, including but
|
|
|
|
|
// not limited to academic journal and conference publications, technical
|
|
|
|
|
// reports and manuals, must cite at least one of the following works:
|
|
|
|
|
//
|
|
|
|
|
// OpenFace: an open source facial behavior analysis toolkit
|
|
|
|
|
// Tadas Baltru<72>aitis, Peter Robinson, and Louis-Philippe Morency
|
|
|
|
|
// in IEEE Winter Conference on Applications of Computer Vision, 2016
|
|
|
|
|
//
|
|
|
|
|
// Rendering of Eyes for Eye-Shape Registration and Gaze Estimation
|
|
|
|
|
// Erroll Wood, Tadas Baltru<72>aitis, Xucong Zhang, Yusuke Sugano, Peter Robinson, and Andreas Bulling
|
|
|
|
|
// in IEEE International. Conference on Computer Vision (ICCV), 2015
|
|
|
|
|
//
|
|
|
|
|
// Cross-dataset learning and person-speci?c normalisation for automatic Action Unit detection
|
|
|
|
|
// Tadas Baltru<72>aitis, Marwa Mahmoud, and Peter Robinson
|
|
|
|
|
// in Facial Expression Recognition and Analysis Challenge,
|
|
|
|
|
// IEEE International Conference on Automatic Face and Gesture Recognition, 2015
|
|
|
|
|
//
|
|
|
|
|
// Constrained Local Neural Fields for robust facial landmark detection in the wild.
|
|
|
|
|
// Tadas Baltru<72>aitis, Peter Robinson, and Louis-Philippe Morency.
|
|
|
|
|
// in IEEE Int. Conference on Computer Vision Workshops, 300 Faces in-the-Wild Challenge, 2013.
|
|
|
|
|
//
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
#include "RecorderOpenFaceParameters.h"
|
|
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
2017-11-08 09:02:50 +00:00
|
|
|
|
using namespace Utilities;
|
2017-11-05 10:30:40 +00:00
|
|
|
|
|
2017-11-06 20:24:04 +00:00
|
|
|
|
RecorderOpenFaceParameters::RecorderOpenFaceParameters(std::vector<std::string> &arguments, bool sequence, double fps_vid_out)
|
2017-11-05 10:30:40 +00:00
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
string separator = string(1, boost::filesystem::path::preferred_separator);
|
|
|
|
|
|
2017-11-06 20:24:04 +00:00
|
|
|
|
this->is_sequence = sequence;
|
|
|
|
|
|
2017-11-05 10:30:40 +00:00
|
|
|
|
this->fps_vid_out = fps_vid_out;
|
2017-11-06 20:24:04 +00:00
|
|
|
|
|
|
|
|
|
// Default output code
|
|
|
|
|
this->output_codec = "DIVX";
|
2017-11-05 10:30:40 +00:00
|
|
|
|
|
|
|
|
|
bool output_set = false;
|
|
|
|
|
|
|
|
|
|
output_2D_landmarks = false;
|
|
|
|
|
output_3D_landmarks = false;
|
|
|
|
|
output_model_params = false;
|
|
|
|
|
output_pose = false;
|
|
|
|
|
output_AUs = false;
|
|
|
|
|
output_gaze = false;
|
|
|
|
|
output_hog = false;
|
2017-11-17 07:54:22 +00:00
|
|
|
|
output_tracked = false;
|
2017-11-05 10:30:40 +00:00
|
|
|
|
output_aligned_faces = false;
|
|
|
|
|
|
|
|
|
|
for (size_t i = 0; i < arguments.size(); ++i)
|
|
|
|
|
{
|
|
|
|
|
if (arguments[i].compare("-simalign") == 0)
|
|
|
|
|
{
|
|
|
|
|
output_aligned_faces = true;
|
|
|
|
|
output_set = true;
|
|
|
|
|
}
|
|
|
|
|
else if (arguments[i].compare("-hogalign") == 0)
|
|
|
|
|
{
|
|
|
|
|
output_hog = true;
|
|
|
|
|
output_set = true;
|
|
|
|
|
}
|
|
|
|
|
else if (arguments[i].compare("-2Dfp") == 0)
|
|
|
|
|
{
|
|
|
|
|
output_2D_landmarks = true;
|
|
|
|
|
output_set = true;
|
|
|
|
|
}
|
|
|
|
|
else if (arguments[i].compare("-3Dfp") == 0)
|
|
|
|
|
{
|
|
|
|
|
output_3D_landmarks = true;
|
|
|
|
|
output_set = true;
|
|
|
|
|
}
|
|
|
|
|
else if (arguments[i].compare("-pdmparams") == 0)
|
|
|
|
|
{
|
|
|
|
|
output_model_params = true;
|
|
|
|
|
output_set = true;
|
|
|
|
|
}
|
|
|
|
|
else if (arguments[i].compare("-pose") == 0)
|
|
|
|
|
{
|
|
|
|
|
output_pose = true;
|
|
|
|
|
output_set = true;
|
|
|
|
|
}
|
|
|
|
|
else if (arguments[i].compare("-aus") == 0)
|
|
|
|
|
{
|
|
|
|
|
output_AUs = true;
|
|
|
|
|
output_set = true;
|
|
|
|
|
}
|
|
|
|
|
else if (arguments[i].compare("-gaze") == 0)
|
|
|
|
|
{
|
|
|
|
|
output_gaze = true;
|
|
|
|
|
output_set = true;
|
|
|
|
|
}
|
|
|
|
|
else if (arguments[i].compare("-tracked") == 0)
|
|
|
|
|
{
|
2017-11-17 07:54:22 +00:00
|
|
|
|
output_tracked = true;
|
2017-11-05 10:30:40 +00:00
|
|
|
|
output_set = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Output everything if nothing has been set
|
|
|
|
|
|
|
|
|
|
if (!output_set)
|
|
|
|
|
{
|
|
|
|
|
output_2D_landmarks = true;
|
|
|
|
|
output_3D_landmarks = true;
|
|
|
|
|
output_model_params = true;
|
|
|
|
|
output_pose = true;
|
|
|
|
|
output_AUs = true;
|
|
|
|
|
output_gaze = true;
|
|
|
|
|
output_hog = true;
|
2017-11-17 07:54:22 +00:00
|
|
|
|
output_tracked = true;
|
2017-11-05 10:30:40 +00:00
|
|
|
|
output_aligned_faces = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|