Some more cleanup.
This commit is contained in:
parent
2513688463
commit
ef031d29db
2 changed files with 6 additions and 19 deletions
|
@ -298,7 +298,7 @@ namespace OpenFaceOffline
|
|||
var landmarks = clnf_model.CalculateAllLandmarks();
|
||||
|
||||
// Predict action units
|
||||
var au_preds = face_analyser.PredictStaticAUsAndComputeFeatures(frame, landmarks, ShowAppearance);
|
||||
var au_preds = face_analyser.PredictStaticAUsAndComputeFeatures(frame, landmarks);
|
||||
|
||||
// Predic eye gaze
|
||||
gaze_analyser.AddNextFrame(clnf_model, detectionSucceeding, reader.GetFx(), reader.GetFy(), reader.GetCx(), reader.GetCy());
|
||||
|
@ -307,7 +307,7 @@ namespace OpenFaceOffline
|
|||
VisualizeFeatures(frame, visualizer_of, landmarks, i == 0, reader.GetFx(), reader.GetFy(), reader.GetCx(), reader.GetCy(), progress);
|
||||
|
||||
// Record an observation
|
||||
RecordObservation(recorder, detectionSucceeding, reader.GetFx(), reader.GetFy(), reader.GetCx(), reader.GetCy());
|
||||
RecordObservation(recorder, visualizer_of.GetVisImage(), detectionSucceeding, reader.GetFx(), reader.GetFy(), reader.GetCx(), reader.GetCy());
|
||||
|
||||
}
|
||||
|
||||
|
@ -396,7 +396,7 @@ namespace OpenFaceOffline
|
|||
detectionSucceeding = ProcessFrame(clnf_model, face_model_params, frame, grayFrame, fx, fy, cx, cy);
|
||||
|
||||
// The face analysis step (for AUs and eye gaze)
|
||||
face_analyser.AddNextFrame(frame, clnf_model.CalculateAllLandmarks(), detectionSucceeding, false, ShowAppearance); // TODO change
|
||||
face_analyser.AddNextFrame(frame, clnf_model.CalculateAllLandmarks(), detectionSucceeding, false);
|
||||
gaze_analyser.AddNextFrame(clnf_model, detectionSucceeding, fx, fy, cx, cy);
|
||||
|
||||
recorder.RecordFrame(clnf_model, face_analyser, gaze_analyser, detectionSucceeding, frame_id + 1, ((double)frame_id) / fps);
|
||||
|
|
|
@ -87,7 +87,6 @@ private:
|
|||
// The actual descriptors (for visualisation and output)
|
||||
cv::Mat_<float>* hog_features;
|
||||
cv::Mat* aligned_face;
|
||||
cv::Mat* visualisation;
|
||||
|
||||
// Variables used for recording things
|
||||
std::ofstream* hog_output_file;
|
||||
|
@ -114,7 +113,6 @@ public:
|
|||
hog_features = new cv::Mat_<float>();
|
||||
|
||||
aligned_face = new cv::Mat();
|
||||
visualisation = new cv::Mat();
|
||||
|
||||
num_rows = new int;
|
||||
num_cols = new int;
|
||||
|
@ -194,7 +192,7 @@ public:
|
|||
face_analyser->PostprocessOutputFile(msclr::interop::marshal_as<std::string>(file));
|
||||
}
|
||||
|
||||
void AddNextFrame(OpenCVWrappers::RawImage^ frame, List<System::Tuple<double, double>^>^ landmarks, bool success, bool online, bool vis_hog) {
|
||||
void AddNextFrame(OpenCVWrappers::RawImage^ frame, List<System::Tuple<double, double>^>^ landmarks, bool success, bool online) {
|
||||
|
||||
// Construct an OpenCV matric from the landmarks
|
||||
cv::Mat_<double> landmarks_mat(landmarks->Count * 2, 1, 0.0);
|
||||
|
@ -216,16 +214,11 @@ public:
|
|||
|
||||
*good_frame = success;
|
||||
|
||||
if(vis_hog)
|
||||
{
|
||||
Utilities::Visualise_FHOG(*hog_features, *num_rows, *num_cols, *visualisation);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Predicting AUs from a single image
|
||||
System::Tuple<Dictionary<System::String^, double>^, Dictionary<System::String^, double>^>^
|
||||
PredictStaticAUsAndComputeFeatures(OpenCVWrappers::RawImage^ frame, List<System::Tuple<double, double>^>^ landmarks, bool vis_hog)
|
||||
PredictStaticAUsAndComputeFeatures(OpenCVWrappers::RawImage^ frame, List<System::Tuple<double, double>^>^ landmarks)
|
||||
{
|
||||
|
||||
// Construct an OpenCV matric from the landmarks
|
||||
|
@ -245,11 +238,6 @@ public:
|
|||
|
||||
face_analyser->GetLatestAlignedFace(*aligned_face);
|
||||
|
||||
if (vis_hog)
|
||||
{
|
||||
Utilities::Visualise_FHOG(*hog_features, *num_rows, *num_cols, *visualisation);
|
||||
}
|
||||
|
||||
// Set the computed AUs
|
||||
auto AU_predictions_intensity = face_analyser->GetCurrentAUsReg();
|
||||
auto AU_predictions_occurence = face_analyser->GetCurrentAUsClass();
|
||||
|
@ -364,7 +352,6 @@ public:
|
|||
{
|
||||
delete hog_features;
|
||||
delete aligned_face;
|
||||
delete visualisation;
|
||||
delete num_cols;
|
||||
delete num_rows;
|
||||
delete hog_output_file;
|
||||
|
|
Loading…
Reference in a new issue