diff --git a/lib/local/LandmarkDetector/include/LandmarkDetectionValidator.h b/lib/local/LandmarkDetector/include/LandmarkDetectionValidator.h index 89a9ef2f..b64af002 100644 --- a/lib/local/LandmarkDetector/include/LandmarkDetectionValidator.h +++ b/lib/local/LandmarkDetector/include/LandmarkDetectionValidator.h @@ -74,9 +74,9 @@ namespace LandmarkDetector { //=========================================================================== // -// Checking if landmark detection was successful using an SVR regressor +// Checking if landmark detection was successful using a CNN // Using multiple validators trained add different views -// The regressor outputs -1 for ideal alignment and 1 for worst alignment +// The regressor outputs 1 for ideal alignment and 0 for worst alignment //=========================================================================== class DetectionValidator { diff --git a/lib/local/LandmarkDetector/include/LandmarkDetectorParameters.h b/lib/local/LandmarkDetector/include/LandmarkDetectorParameters.h index 58c84d87..7fa17a5f 100644 --- a/lib/local/LandmarkDetector/include/LandmarkDetectorParameters.h +++ b/lib/local/LandmarkDetector/include/LandmarkDetectorParameters.h @@ -55,7 +55,7 @@ struct FaceModelParameters // Should face validation be done bool validate_detections; - // Landmark detection validator boundary for correct detection, the regressor output -1 (perfect alignment) 1 (bad alignment), + // Landmark detection validator boundary for correct detection, the regressor output 1 (perfect alignment) 0 (bad alignment), float validation_boundary; // Used when tracking is going well @@ -104,9 +104,6 @@ struct FaceModelParameters // Should the parameters be refined for different scales bool refine_parameters; - // Using the brand new and experimental gaze tracker - bool track_gaze; - FaceModelParameters(); FaceModelParameters(vector &arguments); diff --git a/lib/local/LandmarkDetector/src/LandmarkDetectionValidator.cpp b/lib/local/LandmarkDetector/src/LandmarkDetectionValidator.cpp index 479733ad..3cc400f4 100644 --- a/lib/local/LandmarkDetector/src/LandmarkDetectionValidator.cpp +++ b/lib/local/LandmarkDetector/src/LandmarkDetectionValidator.cpp @@ -377,6 +377,9 @@ float DetectionValidator::Check(const cv::Vec3d& orientation, const cv::Mat_ &image, FaceModelParameters& pa { // Only do the synthetic eye models if we're doing gaze if (!((hierarchical_model_names[part_model].compare("right_eye_28") == 0 || - hierarchical_model_names[part_model].compare("left_eye_28") == 0) - && !params.track_gaze)) + hierarchical_model_names[part_model].compare("left_eye_28") == 0))) { int n_part_points = hierarchical_models[part_model].pdm.NumberOfPoints(); @@ -638,8 +637,7 @@ bool CLNF::DetectLandmarks(const cv::Mat_ &image, FaceModelParameters& pa vector> mappings = this->hierarchical_mapping[part_model]; if (!((hierarchical_model_names[part_model].compare("right_eye_28") == 0 || - hierarchical_model_names[part_model].compare("left_eye_28") == 0) - && !params.track_gaze)) + hierarchical_model_names[part_model].compare("left_eye_28") == 0))) { // Reincorporate the models into main tracker for (size_t mapping_ind = 0; mapping_ind < mappings.size(); ++mapping_ind) @@ -663,7 +661,7 @@ bool CLNF::DetectLandmarks(const cv::Mat_ &image, FaceModelParameters& pa detection_certainty = landmark_validator.Check(orientation, image, detected_landmarks); - detection_success = detection_certainty < params.validation_boundary; + detection_success = detection_certainty > params.validation_boundary; } else { diff --git a/lib/local/LandmarkDetector/src/LandmarkDetectorParameters.cpp b/lib/local/LandmarkDetector/src/LandmarkDetectorParameters.cpp index cb263598..42f02f24 100644 --- a/lib/local/LandmarkDetector/src/LandmarkDetectorParameters.cpp +++ b/lib/local/LandmarkDetector/src/LandmarkDetectorParameters.cpp @@ -148,11 +148,6 @@ FaceModelParameters::FaceModelParameters(vector &arguments) valid[i + 1] = false; i++; } - else if (arguments[i].compare("-gaze") == 0) - { - track_gaze = true; - valid[i] = false; - } else if (arguments[i].compare("-q") == 0) { @@ -301,7 +296,7 @@ void FaceModelParameters::init() reg_factor = 25.0f; weight_factor = 0.0f; // By default do not use NU-RLMS for videos as it does not work as well for them - validation_boundary = -0.45f; + validation_boundary = 0.725f; limit_pose = true; multi_view = false; @@ -316,7 +311,5 @@ void FaceModelParameters::init() // By default use MTCNN curr_face_detector = MTCNN_DETECTOR; - // The gaze tracking has to be explicitly initialised - track_gaze = false; }