Skip to content

Commit e9507fe

Browse files
Some bug fixes when outputting gaze and when loading multiple files for AU processing.
1 parent 04309cb commit e9507fe

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

‎exe/FeatureExtraction/FeatureExtraction.cpp‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -872,7 +872,7 @@ int main (int argc, char **argv)
872872
Point3f gazeDirection0_head;
873873
Point3f gazeDirection1_head;
874874

875-
if (clm_parameters.track_gaze)
875+
if (clm_parameters.track_gaze && detection_success)
876876
{
877877
FaceAnalysis::EstimateGaze(clm_model, gazeDirection0, gazeDirection0_head, fx, fy, cx, cy, true);
878878
FaceAnalysis::EstimateGaze(clm_model, gazeDirection1, gazeDirection1_head, fx, fy, cx, cy, false);
@@ -1152,7 +1152,7 @@ int main (int argc, char **argv)
11521152

11531153
double confidence = 0.5 * (1 - detection_certainty);
11541154

1155-
au_output_file << frame_count + 1 << ", " << timestamps[frame] << ", " << confidence << ", " << detection_success;
1155+
au_output_file << frame + 1 << ", " << timestamps[frame] << ", " << confidence << ", " << detection_success;
11561156
auto aus_reg = face_analyser.GetCurrentAUsReg();
11571157

11581158
for(auto au_reg : predictions_reg)
@@ -1184,6 +1184,7 @@ int main (int argc, char **argv)
11841184
}
11851185
au_output_file << endl;
11861186
}
1187+
face_analyser.Reset();
11871188
}
11881189
// break out of the loop if done with all the files (or using a webcam)
11891190
if(f_n == files.size() -1 || files.empty())

‎lib/local/FaceAnalyser/src/FaceAnalyser.cpp‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,6 +591,15 @@ void FaceAnalyser::Reset()
591591

592592
dyn_scaling = vector<vector<double>>(dyn_scaling.size(), vector<double>(dyn_scaling[0].size(), 5.0));
593593

594+
AU_predictions_reg.clear();
595+
AU_predictions_class.clear();
596+
AU_predictions_combined.clear();
597+
timestamps.clear();
598+
AU_predictions_reg_all_hist.clear();
599+
AU_predictions_class_all_hist.clear();
600+
confidences.clear();
601+
valid_preds.clear();
602+
594603
}
595604

596605
void FaceAnalyser::UpdateRunningMedian(cv::Mat_<unsigned int>& histogram, int& hist_count, cv::Mat_<double>& median, const cv::Mat_<double>& descriptor, bool update, int num_bins, double min_val, double max_val)

0 commit comments

Comments
 (0)