ageitgey / face_recognition

The world's simplest facial recognition api for Python and the command line
MIT License
53.29k stars 13.48k forks source link

where did the value of 128 d dimensional array comes from ? #1195

Open farhanrbnn opened 4 years ago

farhanrbnn commented 4 years ago

i just wanna ask where did the value of 128 d dimensional array comes from ? is it the vector value from HOG feature descriptor or something else ? thank you in advance

392781 commented 4 years ago

I think I can help with this since I worked with dlib before. The 128D vector is the outputted feature vector from a ResNet DNN. dlib has a Python API for it's C++ models that obscures the details of what's going on...

Follow this link to see an example of dlib's facial recognition. You'll see that anet_type is the DNN template that is later initialized as net and takes in the processed faces as a parameter. This then outputs the 128D vector called face_descriptors.

The specific model that's being used is the dlib_face_recognition_resnet_model_v1.

I hope this was helpful. Let me know if you have other questions or if I missed something.