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.
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
, namelytransformed_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.