ageitgey / ageitgey/face_recognition

How can i store data for Annoy of Pynndescent?

Open
#720 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
56.8k
Forks
13.7k
PR merge metrics
No merged PRs in 30d

Description

Hello!

I want to use Annoy (https://github.com/spotify/annoy) of Pynndescent(https://github.com/lmcinnes/pynndescent) (ANN) for faster getting similar faces.
But I do not understand in what form to store data for this? Can I keep them in pickle?
In pickle I write data so:

import face_recognition
import pickle

all_face_encodings = {}
img1 = face_recognition.load_image_file("o2.jpg")
all_face_encodings[1] = face_recognition.face_encodings(img1)[0]

img2 = face_recognition.load_image_file("o1.jpg")
all_face_encodings[2] = face_recognition.face_encodings(img2)[0]

with open('dataset_faces2.dat', 'wb') as f:
    pickle.dump(all_face_encodings, f)

annoy and Pynndescent have methods to import data from files.
Has anyone tried ANN?

Help me please. Thank you advance!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the Annoy and PyNNDescent file-import documentation alongside the face_recognition encoding and pickle example in the issue. A useful resolution would clarify the supported data representation and how stored face identifiers correspond to returned nearest-neighbor results.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
computer-vision, machine-learning
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.