问题
I want to implement something like face recognition application using neural networks. So I found this incredible article.
When we put the face image in the OpenFace network we get 128 measurements which we can use to compare faces.
But here we get the main question: how we can quickly find the same face in the database with the closest 128 values?
If we will use SVM(as it is written in the article) we should to retrain the classifier every time when we put the new face in the db, but it's inexpedient.
So I would to know what is the best approach for this issue? How services like Facebook compare these descriptors in the millisecond?
回答1:
If you have a face and want to search a database of faces for the closest match(es) there's actually only two steps (assuming you've already gotten the 128 OpenFace measurements - which I'll call the OpenFaceRep):
- For each face in your database, subtract its OpenFaceRep from the OpenFaceRep of your seed photo. We'll call this
diff
- Get the dot product of that
diff
with itself. If you're in Python, it would look something likenp.dot(diff,diff)
, and we'll call that thesimilarity
.
The face with lowest similarity
will be the best match. Note that your accuracy will vary quite a bit depending on the quality of your photos, lighting, etc. OpenFace has achieved an accuracy of about 92% on the LFW benchmark.
来源:https://stackoverflow.com/questions/41272915/quick-search-of-the-face-descriptors-in-the-db