ageitgey / face_recognition

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

Feature request to match embeddings to file name so that apart from just matching from a database of images I can also match what image does my test image closest resemble. #1008

Open bundle-adjuster opened 4 years ago

bundle-adjuster commented 4 years ago

Description

I was trying to use the algorithm to look for a face in a dir with many faces. And if it recognizes the face it just says true. I would like to also know which Image matches most with my test image.

lupangxp commented 4 years ago

Try this https://github.com/ageitgey/face_recognition/issues/260

bundle-adjuster commented 4 years ago

@lupangxp I have pretty much, done something similar to this. However, I have a database of say 1000 images. Now I get a new face that I want to know if it exists in my database. The code returns true. But I don't know to which image in the database it returned true if you understand what I mean.

lupangxp commented 4 years ago

Encoding new face and compare with 1000 images use this formula https://github.com/ageitgey/face_recognition/issues/238#issuecomment-345847465

if return distance less than 0.4 this very similar face return row id for other action that you want