ageitgey / face_recognition

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

Regarding the perfomance #279

Closed mlanandnair closed 6 years ago

mlanandnair commented 6 years ago

Hi dude , This is not an issue. I am working on a certain project with face recognition to a identify person and thanks to your library and dlib its working fine . I just want to enquiry about the performance of your library. My scenario is i will collect three image of per user and save it in db. then in the prediction i am using this images to predict who is this person. My question is how much time will it take to predict a person if i have almost 3000 users. ie for the training purpose their will be almost 3000*3 = 9000 images.

ageitgey commented 6 years ago

If you have thousands of faces to compare, you probably want to try one of these two strategies to get faster results:

  1. Train a classifier on top of the face encodings, like in this example: https://github.com/ageitgey/face_recognition/blob/master/examples/face_recognition_knn.py
  2. Put all the face encodings in a database (either sql or elasticsearch) and use the database's query language to do the euclidean distance calculation on each result.
mlanandnair commented 6 years ago

i have gone through your example "https://github.com/ageitgey/face_recognition/blob/master/examples/face_recognition_knn.py" , and worked out that. Its working fine in most of the cases. i have a doubt about the second point .The euclidean distance you mentioned right , Is it the same distance parameter that you mentioned in this example ?. https://github.com/ageitgey/face_recognition/blob/master/examples/face_distance.py

ageitgey commented 6 years ago

Good question! Check out this comment for more info: https://github.com/ageitgey/face_recognition/issues/238#issuecomment-345847465

I'm working on a FAQ since these questions come up so often.