From 51ae19512498a4bb6faade60a7516b2a090e7b0b Mon Sep 17 00:00:00 2001 From: Tadas Baltrusaitis Date: Sun, 31 Jul 2016 16:31:17 -0400 Subject: [PATCH] A number of small fixes, renamings and corrections. --- .travis.yml | 2 +- appveyor.yml | 2 +- exe/FeatureExtraction/FeatureExtraction.cpp | 21 ++-------- .../include/LandmarkDetectorUtils.h | 4 +- .../src/LandmarkDetectorUtils.cpp | 40 ++++++++++++------- .../run_AU_prediction_SEMAINE.m | 2 +- .../Demos/feature_extraction_demo_img_seq.m | 5 +-- .../Demos/feature_extraction_demo_vid.m | 5 +-- matlab_runners/Demos/run_demo_images.m | 4 +- matlab_runners/Demos/run_demo_video_multi.m | 4 +- matlab_runners/Demos/run_demo_videos.m | 4 +- .../Head Pose Experiments/calcBUerror.m | 6 ++- .../Head Pose Experiments/calcBiwiError.m | 8 +++- .../Head Pose Experiments/calcIctError.m | 8 +++- 14 files changed, 61 insertions(+), 54 deletions(-) diff --git a/.travis.yml b/.travis.yml index 757501d..f364ba5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -66,5 +66,5 @@ script: - make -j2 - ../build/bin/FaceLandmarkImg -fdir "../videos/" -ofdir "./demo_img/" -oidir "./demo_img/" -wild -q - ../build/bin/FaceLandmarkVidMulti -f ../videos/multi_face.avi -ov multi_face.avi -q - - ../build/bin/FeatureExtraction -rigid -verbose -f "../videos/1815_01_008_tony_blair.avi" -ov blair.avi -of "output_features/1815_01_008_tony_blair.txt" -simalign output_features/aligned -ov feat_test.avi -hogalign hog_test.dat -q + - ../build/bin/FeatureExtraction -f "../videos/1815_01_008_tony_blair.avi" -ov blair.avi -of "output_features/1815_01_008_tony_blair.txt" -simalign output_features/aligned -ov feat_test.avi -hogalign hog_test.dat -q - ../build/bin/FaceLandmarkVid -f "../videos/1815_01_008_tony_blair.avi" -f "../videos/0188_03_021_al_pacino.avi" -f "../videos/0217_03_006_alanis_morissette.avi" -f "../videos/0244_03_004_anderson_cooper.avi" -q \ No newline at end of file diff --git a/appveyor.yml b/appveyor.yml index 033fe70..47c158c 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -23,5 +23,5 @@ test_script: - cmd: dir - cmd: if exist "../videos" (FaceLandmarkImg.exe -fdir "../videos/" -ofdir "./demo_img/" -oidir "./demo_img/" -wild -q) else (FaceLandmarkImg.exe -fdir "../../videos/" -ofdir "./demo_img/" -oidir "./demo_img/" -wild -q) - cmd: if exist "../videos" (FaceLandmarkVidMulti.exe -f ../videos/multi_face.avi -ov multi_face.avi -q) else (FaceLandmarkVidMulti.exe -f ../../videos/multi_face.avi -ov multi_face.avi -q) - - cmd: if exist "../videos" (FeatureExtraction.exe -rigid -f "../videos/1815_01_008_tony_blair.avi" -of "output_features/1815_01_008_tony_blair.txt" -simalign output_features/aligned -ov feat_track.avi -hogalign hog_test.dat -q) else (FeatureExtraction.exe -rigid -f "../../videos/1815_01_008_tony_blair.avi" -of "output_features/1815_01_008_tony_blair.txt" -simalign output_features/aligned -ov feat_track.avi -hogalign hog_test.dat -q) + - cmd: if exist "../videos" (FeatureExtraction.exe -f "../videos/1815_01_008_tony_blair.avi" -of "output_features/1815_01_008_tony_blair.txt" -simalign output_features/aligned -ov feat_track.avi -hogalign hog_test.dat -q) else (FeatureExtraction.exe -f "../../videos/1815_01_008_tony_blair.avi" -of "output_features/1815_01_008_tony_blair.txt" -simalign output_features/aligned -ov feat_track.avi -hogalign hog_test.dat -q) - cmd: if exist "../videos" (FaceLandmarkVid.exe -f "../videos/1815_01_008_tony_blair.avi" -ov track.avi -q) else (FaceLandmarkVid.exe -f "../../videos/1815_01_008_tony_blair.avi" -ov track.avi -q) diff --git a/exe/FeatureExtraction/FeatureExtraction.cpp b/exe/FeatureExtraction/FeatureExtraction.cpp index 8100158..c0048a2 100644 --- a/exe/FeatureExtraction/FeatureExtraction.cpp +++ b/exe/FeatureExtraction/FeatureExtraction.cpp @@ -153,9 +153,8 @@ void create_directory(string output_path) } void get_output_feature_params(vector &output_similarity_aligned, vector &output_hog_aligned_files, double &similarity_scale, - int &similarity_size, bool &grayscale, bool &rigid, bool& verbose, bool& dynamic, - bool &output_2D_landmarks, bool &output_3D_landmarks, bool &output_model_params, bool &output_pose, bool &output_AUs, bool &output_gaze, - vector &arguments); + int &similarity_size, bool &grayscale, bool& verbose, bool& dynamic, bool &output_2D_landmarks, bool &output_3D_landmarks, + bool &output_model_params, bool &output_pose, bool &output_AUs, bool &output_gaze, vector &arguments); void get_image_input_output_params_feats(vector > &input_image_files, bool& as_video, vector &arguments); @@ -305,7 +304,6 @@ int main (int argc, char **argv) int sim_size = 112; bool grayscale = false; bool video_output = false; - bool rigid = false; bool dynamic = true; // Indicates if a dynamic AU model should be used (dynamic is useful if the video is long enough to include neutral expressions) int num_hog_rows; int num_hog_cols; @@ -319,7 +317,7 @@ int main (int argc, char **argv) bool output_AUs = true; bool output_gaze = true; - get_output_feature_params(output_similarity_align, output_hog_align_files, sim_scale, sim_size, grayscale, rigid, verbose, dynamic, + get_output_feature_params(output_similarity_align, output_hog_align_files, sim_scale, sim_size, grayscale, verbose, dynamic, output_2D_landmarks, output_3D_landmarks, output_model_params, output_pose, output_AUs, output_gaze, arguments); // Used for image masking @@ -1022,7 +1020,7 @@ void outputAllFeatures(std::ofstream* output_file, bool output_2D_landmarks, boo void get_output_feature_params(vector &output_similarity_aligned, vector &output_hog_aligned_files, double &similarity_scale, - int &similarity_size, bool &grayscale, bool &rigid, bool& verbose, bool& dynamic, + int &similarity_size, bool &grayscale, bool& verbose, bool& dynamic, bool &output_2D_landmarks, bool &output_3D_landmarks, bool &output_model_params, bool &output_pose, bool &output_AUs, bool &output_gaze, vector &arguments) { @@ -1036,7 +1034,6 @@ void get_output_feature_params(vector &output_similarity_aligned, vector valid[i] = true; } - string input_root = ""; string output_root = ""; // By default the model is dynamic @@ -1047,15 +1044,9 @@ void get_output_feature_params(vector &output_similarity_aligned, vector { if (arguments[i].compare("-root") == 0) { - input_root = arguments[i + 1]; output_root = arguments[i + 1]; i++; } - if (arguments[i].compare("-inroot") == 0) - { - input_root = arguments[i + 1]; - i++; - } if (arguments[i].compare("-outroot") == 0) { output_root = arguments[i + 1]; @@ -1085,10 +1076,6 @@ void get_output_feature_params(vector &output_similarity_aligned, vector { verbose = true; } - else if (arguments[i].compare("-rigid") == 0) - { - rigid = true; - } else if (arguments[i].compare("-au_static") == 0) { dynamic = false; diff --git a/lib/local/LandmarkDetector/include/LandmarkDetectorUtils.h b/lib/local/LandmarkDetector/include/LandmarkDetectorUtils.h index 200cbe1..87d2c5b 100644 --- a/lib/local/LandmarkDetector/include/LandmarkDetectorUtils.h +++ b/lib/local/LandmarkDetector/include/LandmarkDetectorUtils.h @@ -76,8 +76,8 @@ namespace LandmarkDetector //============================================================================================= // Helper functions for parsing the inputs //============================================================================================= - void get_video_input_output_params(vector &input_video_file, vector &depth_dir, - vector &output_files, vector &output_video_files, bool& world_coordinates_pose, vector &arguments); + void get_video_input_output_params(vector &input_video_file, vector &depth_dir, vector &output_files, + vector &output_video_files, bool& world_coordinates_pose, vector &arguments); void get_camera_params(int &device, float &fx, float &fy, float &cx, float &cy, vector &arguments); diff --git a/lib/local/LandmarkDetector/src/LandmarkDetectorUtils.cpp b/lib/local/LandmarkDetector/src/LandmarkDetectorUtils.cpp index 6361960..f875f62 100644 --- a/lib/local/LandmarkDetector/src/LandmarkDetectorUtils.cpp +++ b/lib/local/LandmarkDetector/src/LandmarkDetectorUtils.cpp @@ -115,8 +115,8 @@ void create_directories(string output_path) } // Extracting the following command line arguments -f, -fd, -op, -of, -ov (and possible ordered repetitions) -void get_video_input_output_params(vector &input_video_files, vector &depth_dirs, - vector &output_files, vector &output_video_files, bool& world_coordinates_pose, vector &arguments) +void get_video_input_output_params(vector &input_video_files, vector &depth_dirs, vector &output_files, + vector &output_video_files, bool& world_coordinates_pose, vector &arguments) { bool* valid = new bool[arguments.size()]; @@ -128,46 +128,58 @@ void get_video_input_output_params(vector &input_video_files, vector