Adding more preparation for MTCNN in C++

This commit is contained in:
Tadas Baltrusaitis
2017-08-09 12:01:53 -04:00
parent 8b5f8b9a36
commit 8dea625717
18 changed files with 273 additions and 22 deletions

View File

@@ -67,8 +67,8 @@ CLNF::CLNF(string fname)
// Copy constructor (makes a deep copy of CLNF)
CLNF::CLNF(const CLNF& other): pdm(other.pdm), params_local(other.params_local.clone()), params_global(other.params_global), detected_landmarks(other.detected_landmarks.clone()),
landmark_likelihoods(other.landmark_likelihoods.clone()), patch_experts(other.patch_experts), landmark_validator(other.landmark_validator), face_detector_location(other.face_detector_location),
hierarchical_mapping(other.hierarchical_mapping), hierarchical_models(other.hierarchical_models), hierarchical_model_names(other.hierarchical_model_names),
landmark_likelihoods(other.landmark_likelihoods.clone()), patch_experts(other.patch_experts), landmark_validator(other.landmark_validator), haar_face_detector_location(other.haar_face_detector_location),
mtcnn_face_detector_location(other.mtcnn_face_detector_location), hierarchical_mapping(other.hierarchical_mapping), hierarchical_models(other.hierarchical_models), hierarchical_model_names(other.hierarchical_model_names),
hierarchical_params(other.hierarchical_params), eye_model(other.eye_model)
{
this->detection_success = other.detection_success;
@@ -78,9 +78,9 @@ CLNF::CLNF(const CLNF& other): pdm(other.pdm), params_local(other.params_local.c
this->failures_in_a_row = other.failures_in_a_row;
// Load the CascadeClassifier (as it does not have a proper copy constructor)
if(!face_detector_location.empty())
if(!haar_face_detector_location.empty())
{
this->face_detector_HAAR.load(face_detector_location);
this->face_detector_HAAR.load(haar_face_detector_location);
}
// Make sure the matrices are allocated properly
this->triangulations.resize(other.triangulations.size());
@@ -114,7 +114,8 @@ CLNF & CLNF::operator= (const CLNF& other)
landmark_likelihoods =other.landmark_likelihoods.clone();
patch_experts = Patch_experts(other.patch_experts);
landmark_validator = DetectionValidator(other.landmark_validator);
face_detector_location = other.face_detector_location;
haar_face_detector_location = other.haar_face_detector_location;
mtcnn_face_detector_location = other.mtcnn_face_detector_location;
this->detection_success = other.detection_success;
this->tracking_initialised = other.tracking_initialised;
@@ -125,9 +126,9 @@ CLNF & CLNF::operator= (const CLNF& other)
this->eye_model = other.eye_model;
// Load the CascadeClassifier (as it does not have a proper copy constructor)
if(!face_detector_location.empty())
if(!haar_face_detector_location.empty())
{
this->face_detector_HAAR.load(face_detector_location);
this->face_detector_HAAR.load(haar_face_detector_location);
}
// Make sure the matrices are allocated properly
this->triangulations.resize(other.triangulations.size());
@@ -172,7 +173,8 @@ CLNF::CLNF(const CLNF&& other)
landmark_likelihoods = other.landmark_likelihoods;
patch_experts = other.patch_experts;
landmark_validator = other.landmark_validator;
face_detector_location = other.face_detector_location;
haar_face_detector_location = other.haar_face_detector_location;
mtcnn_face_detector_location = other.mtcnn_face_detector_location;
face_detector_HAAR = other.face_detector_HAAR;
@@ -207,7 +209,8 @@ CLNF & CLNF::operator= (const CLNF&& other)
landmark_likelihoods = other.landmark_likelihoods;
patch_experts = other.patch_experts;
landmark_validator = other.landmark_validator;
face_detector_location = other.face_detector_location;
haar_face_detector_location = other.haar_face_detector_location;
mtcnn_face_detector_location = other.mtcnn_face_detector_location;
face_detector_HAAR = other.face_detector_HAAR;