diff --git a/lib/local/LandmarkDetector/include/LandmarkDetectorParameters.h b/lib/local/LandmarkDetector/include/LandmarkDetectorParameters.h index 4ed5b24b..71f0b32f 100644 --- a/lib/local/LandmarkDetector/include/LandmarkDetectorParameters.h +++ b/lib/local/LandmarkDetector/include/LandmarkDetectorParameters.h @@ -99,9 +99,6 @@ struct FaceModelParameters string mtcnn_face_detector_location; FaceDetector curr_face_detector; - // Should the results be visualised and reported to console - bool quiet_mode; - // Should the model be refined hierarchically (if available) bool refine_hierarchical; diff --git a/lib/local/LandmarkDetector/src/LandmarkDetectorParameters.cpp b/lib/local/LandmarkDetector/src/LandmarkDetectorParameters.cpp index 95233d56..97245808 100644 --- a/lib/local/LandmarkDetector/src/LandmarkDetectorParameters.cpp +++ b/lib/local/LandmarkDetector/src/LandmarkDetectorParameters.cpp @@ -150,13 +150,6 @@ FaceModelParameters::FaceModelParameters(vector &arguments) valid[i + 1] = false; i++; } - else if (arguments[i].compare("-q") == 0) - { - - quiet_mode = true; - - valid[i] = false; - } else if (arguments[i].compare("-wild") == 0) { // For in the wild fitting these parameters are suitable @@ -345,7 +338,6 @@ void FaceModelParameters::init() // Face detection haar_face_detector_location = "classifiers/haarcascade_frontalface_alt.xml"; mtcnn_face_detector_location = "model/mtcnn_detector/MTCNN_detector.txt"; - quiet_mode = false; // By default use MTCNN curr_face_detector = MTCNN_DETECTOR; diff --git a/lib/local/Utilities/include/RecorderOpenFaceParameters.h b/lib/local/Utilities/include/RecorderOpenFaceParameters.h index f27c2caf..e6c44196 100644 --- a/lib/local/Utilities/include/RecorderOpenFaceParameters.h +++ b/lib/local/Utilities/include/RecorderOpenFaceParameters.h @@ -70,6 +70,8 @@ namespace Utilities bool outputTracked() const { return output_tracked; } bool outputAlignedFaces() const { return output_aligned_faces; } std::string outputCodec() const { return output_codec; } + std::string imageFormatAligned() const { return image_format_aligned; } + std::string imageFormatVisualization() const { return image_format_visualization; } double outputFps() const { return fps_vid_out; } bool outputBadAligned() const { return record_aligned_bad; } @@ -107,6 +109,10 @@ namespace Utilities std::string output_codec; double fps_vid_out; + // Image recording parameters + std::string image_format_aligned; + std::string image_format_visualization; + // Camera parameters for recording in the meta file; float fx, fy, cx, cy; diff --git a/lib/local/Utilities/src/RecorderOpenFace.cpp b/lib/local/Utilities/src/RecorderOpenFace.cpp index a6e24b39..633fbb1e 100644 --- a/lib/local/Utilities/src/RecorderOpenFace.cpp +++ b/lib/local/Utilities/src/RecorderOpenFace.cpp @@ -197,7 +197,7 @@ void RecorderOpenFace::PrepareRecording(const std::string& in_filename) } else { - this->media_filename = out_name + ".jpg"; + this->media_filename = out_name + "." + params.imageFormatVisualization(); metadata_file << "Output image:" << this->media_filename << endl; this->media_filename = (path(record_root) / this->media_filename).string(); } @@ -378,18 +378,18 @@ void RecorderOpenFace::WriteObservation() char name[100]; - // Filename is based on frame number + // Filename is based on frame number (TODO stringstream this) if(params.isSequence()) - std::sprintf(name, "frame_det_%02d_%06d.bmp", face_id, frame_number); + std::sprintf(name, "frame_det_%02d_%06d.", face_id, frame_number); else - std::sprintf(name, "face_det_%06d.bmp", face_id); + std::sprintf(name, "face_det_%06d.", face_id); // Construct the output filename boost::filesystem::path slash("/"); std::string preferredSlash = slash.make_preferred().string(); - string out_file = aligned_output_directory + preferredSlash + string(name); + string out_file = aligned_output_directory + preferredSlash + string(name) + params.imageFormatAligned(); if(params.outputBadAligned() || landmark_detection_success) { diff --git a/lib/local/Utilities/src/RecorderOpenFaceParameters.cpp b/lib/local/Utilities/src/RecorderOpenFaceParameters.cpp index 11786764..a00289e1 100644 --- a/lib/local/Utilities/src/RecorderOpenFaceParameters.cpp +++ b/lib/local/Utilities/src/RecorderOpenFaceParameters.cpp @@ -58,6 +58,9 @@ RecorderOpenFaceParameters::RecorderOpenFaceParameters(std::vector // Default output code this->output_codec = "DIVX"; + this->image_format_aligned = "bmp"; + this->image_format_visualization = "jpg"; + bool output_set = false; this->output_2D_landmarks = false; @@ -74,6 +77,16 @@ RecorderOpenFaceParameters::RecorderOpenFaceParameters(std::vector for (size_t i = 0; i < arguments.size(); ++i) { + if (arguments[i].compare("-format_aligned") == 0) + { + this->image_format_aligned = arguments[i+1]; + i++; + } + if (arguments[i].compare("-format_vis_image") == 0) + { + this->image_format_visualization = arguments[i + 1]; + i++; + } if (arguments[i].compare("-nobadaligned") == 0) { this->record_aligned_bad = false;