From 5a483f74867face0f0404286d7469b6ebe83ab20 Mon Sep 17 00:00:00 2001 From: Tadas Baltrusaitis Date: Fri, 17 Nov 2017 07:54:22 +0000 Subject: [PATCH] Bug fix with default recording directory. --- lib/local/Utilities/include/RecorderOpenFace.h | 3 ++- lib/local/Utilities/src/RecorderOpenFace.cpp | 4 ++++ lib/local/Utilities/src/RecorderOpenFaceParameters.cpp | 6 +++--- matlab_runners/Head Pose Experiments/run_biwi_experiment.m | 2 +- matlab_runners/Head Pose Experiments/run_ict_experiment.m | 2 +- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/lib/local/Utilities/include/RecorderOpenFace.h b/lib/local/Utilities/include/RecorderOpenFace.h index 4200219..4ceb8fa 100644 --- a/lib/local/Utilities/include/RecorderOpenFace.h +++ b/lib/local/Utilities/include/RecorderOpenFace.h @@ -104,7 +104,8 @@ namespace Utilities const RecorderOpenFaceParameters params; // Keep track of the file and output root location - std::string record_root = "processed"; // By default we are writing in the processed directory in the working directory + std::string record_root; + std::string default_record_directory = "processed"; // By default we are writing in the processed directory in the working directory, if no output parameters provided std::string of_filename; std::string filename; std::string csv_filename; diff --git a/lib/local/Utilities/src/RecorderOpenFace.cpp b/lib/local/Utilities/src/RecorderOpenFace.cpp index ef20f97..5af041e 100644 --- a/lib/local/Utilities/src/RecorderOpenFace.cpp +++ b/lib/local/Utilities/src/RecorderOpenFace.cpp @@ -109,6 +109,10 @@ RecorderOpenFace::RecorderOpenFace(const std::string in_filename, RecorderOpenFa } } + // If recording directory not set, record to default location + if (record_root.empty()) + record_root = default_record_directory; + for (int i = (int)arguments.size() - 1; i >= 0; --i) { if (!valid[i]) diff --git a/lib/local/Utilities/src/RecorderOpenFaceParameters.cpp b/lib/local/Utilities/src/RecorderOpenFaceParameters.cpp index a563f7a..91565db 100644 --- a/lib/local/Utilities/src/RecorderOpenFaceParameters.cpp +++ b/lib/local/Utilities/src/RecorderOpenFaceParameters.cpp @@ -73,7 +73,7 @@ RecorderOpenFaceParameters::RecorderOpenFaceParameters(std::vector output_AUs = false; output_gaze = false; output_hog = false; - output_tracked_video = false; + output_tracked = false; output_aligned_faces = false; for (size_t i = 0; i < arguments.size(); ++i) @@ -120,7 +120,7 @@ RecorderOpenFaceParameters::RecorderOpenFaceParameters(std::vector } else if (arguments[i].compare("-tracked") == 0) { - output_tracked_video = true; + output_tracked = true; output_set = true; } } @@ -136,7 +136,7 @@ RecorderOpenFaceParameters::RecorderOpenFaceParameters(std::vector output_AUs = true; output_gaze = true; output_hog = true; - output_tracked_video = true; + output_tracked = true; output_aligned_faces = true; } diff --git a/matlab_runners/Head Pose Experiments/run_biwi_experiment.m b/matlab_runners/Head Pose Experiments/run_biwi_experiment.m index b7706eb..5690a2f 100644 --- a/matlab_runners/Head Pose Experiments/run_biwi_experiment.m +++ b/matlab_runners/Head Pose Experiments/run_biwi_experiment.m @@ -14,7 +14,7 @@ dbSeqDir = dbSeqDir(3:end); output_dir = cat(2, output_dir, '/'); -command = sprintf('%s -inroot "%s" -outroot "%s" -fx 505 -fy 505 -cx 320 -cy 240 -pose -vis-track ', executable, rootDir, output_dir); +command = sprintf('%s -inroot "%s" -out_dir "%s" -fx 505 -fy 505 -cx 320 -cy 240 -pose -vis-track ', executable, rootDir, output_dir); if(verbose) command = cat(2, command, [' -tracked ' outputVideo]); diff --git a/matlab_runners/Head Pose Experiments/run_ict_experiment.m b/matlab_runners/Head Pose Experiments/run_ict_experiment.m index 1d0f8ff..06b1f60 100644 --- a/matlab_runners/Head Pose Experiments/run_ict_experiment.m +++ b/matlab_runners/Head Pose Experiments/run_ict_experiment.m @@ -15,7 +15,7 @@ dbSeqDir = dbSeqDir(3:end); output_dir = cat(2, output_dir, '/'); -command = sprintf('%s -inroot "%s" -outroot "%s" -fx 535 -fy 536 -cx 327 -cy 241 -pose -vis-track ', executable, rootDir, output_dir); +command = sprintf('%s -inroot "%s" -out_dir "%s" -fx 535 -fy 536 -cx 327 -cy 241 -pose -vis-track ', executable, rootDir, output_dir); if(verbose) command = cat(2, command, [' -tracked ' outputVideo]);