gitmyhub

facenet

Python ★ 14k updated 2y ago

Face recognition using Tensorflow

Face recognition system using TensorFlow that converts face photos into numeric embeddings for comparing, grouping, or identifying people, includes pre-trained models ready to use.

PythonTensorFlowMTCNNsetup: hardcomplexity 4/5

This project is a face recognition system built with TensorFlow, Google's machine learning library. It is an implementation of a method described in a research paper called FaceNet, and it also borrows ideas from a second paper on deep face recognition from a group at Oxford. The README states the code was heavily inspired by an earlier project called OpenFace.

The basic idea is to turn a photo of a face into a short list of numbers, which the field calls an embedding. The system is trained so that two photos of the same person produce number lists that are close together, while photos of different people produce lists that are far apart. Once you have these number lists, you can compare faces, group them, or build a classifier that names who is in a picture.

Before a face goes into the model, the picture is cleaned up in a step called alignment. The README explains that a simpler face detector missed harder cases such as partly hidden faces or silhouettes, so the project switched to a method called MTCNN, a multi-task neural network that finds and lines up faces more reliably. A Python and TensorFlow version of MTCNN is included.

The authors provide pre-trained models so you do not have to train from scratch, which would need a large dataset and a lot of computing time. Two models are listed, trained on public face datasets called CASIA-WebFace and VGGFace2, the larger of which contains roughly 3.3 million faces. On a standard benchmark named LFW, the best model reaches about 99.6 percent accuracy.

The README also includes a dated news log of changes, notes on which TensorFlow versions the code was tested against, and links to wiki pages describing how to train your own classifier and how to run the validation test. It reminds users to credit the people who provided the training datasets.

Where it fits