ageitgey / face_recognition

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

Faster face recognition in base with more than 1 million encodings. #692

Open arpsyapathy opened 5 years ago

arpsyapathy commented 5 years ago

Hello! I want to collect pre-calculated encodings of more than 1 million faces in database (mysql,postgres...?) with 128 columns. And i have face,which I want to find among them. And than i want search top 5 the most similar faces for need face.

In this https://github.com/ageitgey/face_recognition/issues/238 have already been tips on this subject @khaledabbad already have solution with Apache Solr. But I'm not familiar with Apache and I don't know how to make a search engine.

What are the possible solutions to find encoding of 1 face in the base of encodings more than 1 million persons? How can you do it as faster as possible? Solr or other? Examples?

Thank you advance!

ageitgey commented 5 years ago

You might also consider using an approximate nearest neighbors model like https://github.com/lmcinnes/pynndescent/ or Spotify's Annoy project. It speeds up the search for matches by not actually checking every encoding. It's not going to work for every project, but it might work depending on your specific requirements and whether you have lots of images of each person or not.

arpsyapathy commented 5 years ago

@ageitgey

Thanks you. How to compare if encoding not needed? Can you give an example (pynndescent of annoy)? How to store data for this? sql or Pickle?