diff --git a/gui/OpenFaceOffline/MainWindow.xaml.cs b/gui/OpenFaceOffline/MainWindow.xaml.cs index c5971c5..92fa112 100644 --- a/gui/OpenFaceOffline/MainWindow.xaml.cs +++ b/gui/OpenFaceOffline/MainWindow.xaml.cs @@ -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); diff --git a/lib/local/CppInerop/FaceAnalyserInterop.h b/lib/local/CppInerop/FaceAnalyserInterop.h index 3573241..4030f8a 100644 --- a/lib/local/CppInerop/FaceAnalyserInterop.h +++ b/lib/local/CppInerop/FaceAnalyserInterop.h @@ -87,7 +87,6 @@ private: // The actual descriptors (for visualisation and output) cv::Mat_* 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_(); 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(file)); } - void AddNextFrame(OpenCVWrappers::RawImage^ frame, List^>^ landmarks, bool success, bool online, bool vis_hog) { + void AddNextFrame(OpenCVWrappers::RawImage^ frame, List^>^ landmarks, bool success, bool online) { // Construct an OpenCV matric from the landmarks cv::Mat_ landmarks_mat(landmarks->Count * 2, 1, 0.0); @@ -215,17 +213,12 @@ public: face_analyser->GetLatestAlignedFace(*aligned_face); *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^>^ - PredictStaticAUsAndComputeFeatures(OpenCVWrappers::RawImage^ frame, List^>^ landmarks, bool vis_hog) + PredictStaticAUsAndComputeFeatures(OpenCVWrappers::RawImage^ frame, List^>^ 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;