Tobias-Fischer / rt_gene

RT-GENE: Real-Time Eye Gaze and Blink Estimation in Natural Environments
http://www.imperial.ac.uk/personal-robotics
Other
366 stars 68 forks source link

Face encoding #24

Closed ahmed-alhindawi closed 5 years ago

ahmed-alhindawi commented 5 years ago

As per #23

This pull request creates an "encoding" of each tracked subject only when adding the new subject. The initial insertion takes 50ms for the encoding and is then only ran again if the Hungarian tracker loses the subject and adds a new subject.

It reuses the variables already in TrackedSubject, namely transformed_landmarks to align the image rotating it facing upwards and then resizes it to 150x150 to then pass it to dlib to encode it.

There's a new param "face_encoding_tracker" that enables the tracking at init time. The default is False to keep it consistent with downstream code and thus has no runtime overhead.

I've tested this with faces from the internet along mine and it seems to work quite reliably. The speed of the networks (face detectors, landmark extractors and eye gaze estimators) are unaffected.