deepinsight / deepinsight/insightface

What models are necessary to obtain face embeddings?

Open
#2,393 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
29.7k
Forks
6.1k
PR merge metrics
No merged PRs in 30d

Description

First of all, thank you for this great library. I'm attempting to speed up the calculation of embeddings for faces, but I'm somewhat confused. If I use allowed_modules=['recognition', 'detection'], it indeed results in an approximate 30% speedup, and the vectors seem to be the same (within a range of approximately 1e-5). However, I had assumed that the algorithm for embeddings used alignment, relying on a model that detects key points.
So, it appears that only two models are necessary to obtain embeddings: recognition and detection. Is it correct to understand that no alignment is performed by default?
The code I'm using:

```
from insightface.app import FaceAnalysis

allowed_modules = ['recognition', 'detection']
app = FaceAnalysis(name='antelopev2', providers=['CUDAExecutionProvider'],
allowed_modules=allowed_modules)
app.prepare(ctx_id=1)

t = time()
for _ in tqdm(range(1000)):
res = app.get(img_array)

print(time()-t)
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.