face detect only function
Closed this issue · 4 comments
Hi Kagami,
Thanks for the great work. This is one very nice go implementation of dlib face recognition.
Looking at facerec.cc, the Recognize function does both the face detection and face encoding. I want to try to add a function that does face detection only. Do you think I should sort the rectangles before I return them? You sort the rectangles before you apply the face encoding so I figure I should do the same before returning the face locations.
Hi. I think yes, you should. It's more convenient if you know which element of face slice belongs to person on the image, just by looking at the image (at least in simple case with few faces on the image). Instead of checking the coordinates. I've measured for how long detector_(img)
executes and it's >100ms in my case, so sorting won't be a bottleneck.
Nice. yeah, in my desktop the face recognition (including detection) took around 800ms for the pristin.jpg. the single-face file took around 300ms so maybe face encoding takes more than twice as long as face detection.
I wonder how much overhead cgo introduces during each call though.
how much overhead cgo introduces during each call though
Not much compared to the actual recognition.
I am closing this issue since it is probably better to do only 1 cgo call to do both face detection and recognition instead of using two separate calls. might add a pr in case a need arise for a face detect only function.