This repository contains face recognition service: ML scripts & API to use them.
ML pipeline contains four main steps:
- face detection to crop faces from images (RetinaFace is used);
- face alignment to descrease the distribution variance;
- feature extraction (InsightFace is used);
- kNN based on cosine distance on top of feature vectors.
ML pipeline is encapsulated into Index class which provides two main methods: add and find.
Index can be used in two ways: eyes-only (works better with masked people) and full faces (works better with open faces). See face/ for details.
Using full face
Using only eyes area
- add CUDA support for faster inference;
- adapt alignment algorithm from InsightFace instead of own implementation to decrease distribution shift;
- nearest neighbours algoritm is full-scan (O(n) complexity, needs to be replaced with approximate NN search, e.g.
nmslib).
API is written with Tornado framework. End-points:
- /analyze_face - handle post request, that contains image with human face/faces as payload. Return back results of recognition by classifier with extracted embeddings.

