Dealing better with online mode in feature extraction.

This commit is contained in:
Tadas Baltrusaitis 2017-11-25 09:22:34 +00:00
parent 77cf256dc3
commit c5749cc3ba
2 changed files with 8 additions and 11 deletions

View File

@ -134,6 +134,8 @@ int main (int argc, char **argv)
if (sequence_reader.IsWebcam())
{
INFO_STREAM("WARNING: using a webcam in feature extraction, Action Unit predictions will not be as accurate in real-time webcam mode");
INFO_STREAM("WARNING: using a webcam in feature extraction, forcing visualization of tracking to allow quitting the application (press q)");
visualizer.vis_track = true;
}
cv::Mat captured_image;

View File

@ -478,20 +478,15 @@ void FaceAnalyser::AddNextFrame(const cv::Mat& frame, const cv::Mat_<float>& det
if (online)
{
AU_predictions_reg_corrected = CorrectOnlineAUs(AU_predictions_reg, orientation_to_use, true, false, success, true);
}
if(online)
{
AU_predictions_reg = AU_predictions_reg_corrected;
}
else
// Useful for prediction corrections (calibration after the whole video is processed)
if (success && frames_tracking_succ - 1 < max_init_frames)
{
if (success && frames_tracking_succ - 1 < max_init_frames)
{
hog_desc_frames_init.push_back(hog_descriptor);
geom_descriptor_frames_init.push_back(geom_descriptor_frame);
views.push_back(orientation_to_use);
}
hog_desc_frames_init.push_back(hog_descriptor);
geom_descriptor_frames_init.push_back(geom_descriptor_frame);
views.push_back(orientation_to_use);
}
this->current_time_seconds = timestamp_seconds;