ランキングに戻る

davidsandberg/facenet

Python

Face recognition using Tensorflow

face-recognitiontensorflowfacenetdeep-learningcomputer-visionface-detectionmtcnn
スター成長
スター
14.3k
フォーク
4.8k
週間成長
Issue
511
5k10k
2016年2月2019年7月2023年1月2026年7月
成果物PyPIpip install facenet
README

Face Recognition using Tensorflow Build Status

This is a TensorFlow implementation of the face recognizer described in the paper "FaceNet: A Unified Embedding for Face Recognition and Clustering". The project also uses ideas from the paper "Deep Face Recognition" from the Visual Geometry Group at Oxford.

Compatibility

The code is tested using Tensorflow r1.7 under Ubuntu 14.04 with Python 2.7 and Python 3.5. The test cases can be found here and the results can be found here.

News

Date Update
2018-04-10 Added new models trained on Casia-WebFace and VGGFace2 (see below). Note that the models uses fixed image standardization (see wiki).
2018-03-31 Added a new, more flexible input pipeline as well as a bunch of minor updates.
2017-05-13 Removed a bunch of older non-slim models. Moved the last bottleneck layer into the respective models. Corrected normalization of Center Loss.
2017-05-06 Added code to train a classifier on your own images. Renamed facenet_train.py to train_tripletloss.py and facenet_train_classifier.py to train_softmax.py.
2017-03-02 Added pretrained models that generate 128-dimensional embeddings.
2017-02-22 Updated to Tensorflow r1.0. Added Continuous Integration using Travis-CI.
2017-02-03 Added models where only trainable variables has been stored in the checkpoint. These are therefore significantly smaller.
2017-01-27 Added a model trained on a subset of the MS-Celeb-1M dataset. The LFW accuracy of this model is around 0.994.
2017‑01‑02 Updated to run with Tensorflow r0.12. Not sure if it runs with older versions of Tensorflow though.

Pre-trained models

Model name LFW accuracy Training dataset Architecture
20180408-102900 0.9905 CASIA-WebFace Inception ResNet v1
20180402-114759 0.9965 VGGFace2 Inception ResNet v1

NOTE: If you use any of the models, please do not forget to give proper credit to those providing the training dataset as well.

Inspiration

The code is heavily inspired by the OpenFace implementation.

Training data

The CASIA-WebFace dataset has been used for training. This training set consists of total of 453 453 images over 10 575 identities after face detection. Some performance improvement has been seen if the dataset has been filtered before training. Some more information about how this was done will come later. The best performing model has been trained on the VGGFace2 dataset consisting of ~3.3M faces and ~9000 classes.

Pre-processing

Face alignment using MTCNN

One problem with the above approach seems to be that the Dlib face detector misses some of the hard examples (partial occlusion, silhouettes, etc). This makes the training set too "easy" which causes the model to perform worse on other benchmarks. To solve this, other face landmark detectors has been tested. One face landmark detector that has proven to work very well in this setting is the Multi-task CNN. A Matlab/Caffe implementation can be found here and this has been used for face alignment with very good results. A Python/Tensorflow implementation of MTCNN can be found here. This implementation does not give identical results to the Matlab/Caffe implementation but the performance is very similar.

Running training

Currently, the best results are achieved by training the model using softmax loss. Details on how to train a model using softmax loss on the CASIA-WebFace dataset can be found on the page Classifier training of Inception-ResNet-v1 and .

Pre-trained models

Inception-ResNet-v1 model

A couple of pretrained models are provided. They are trained using softmax loss with the Inception-Resnet-v1 model. The datasets has been aligned using MTCNN.

Performance

The accuracy on LFW for the model 20180402-114759 is 0.99650+-0.00252. A description of how to run the test can be found on the page Validate on LFW. Note that the input images to the model need to be standardized using fixed image standardization (use the option --use_fixed_image_standardization when running e.g. validate_on_lfw.py).

関連リポジトリ
ageitgey/face_recognition

The world's simplest facial recognition api for Python and the command line

PythonPyPIMIT Licensemachine-learningface-detection
56.6k13.7k
deepinsight/insightface

State-of-the-art 2D and 3D Face Analysis Project

PythonPyPIface-recognitionface-detection
insightface.ai
29.3k6.1k
serengil/deepface

A Lightweight Face Recognition and Facial Attribute Analysis (Age, Gender, Emotion and Race) Library for Python

PythonPyPIMIT Licenseface-recognitionvgg-face
youtube.com/watch
23.1k3.1k
Zeyi-Lin/HivisionIDPhotos

⚡️HivisionIDPhotos: a lightweight and efficient AI ID photos tools. 一个轻量级的AI证件照制作算法。

PythonPyPIApache License 2.0demogradio
modelscope.cn/studios/SwanLab/HivisionIDPhotos
21.3k2.4k
justadudewhohacks/face-api.js

JavaScript API for face detection and face recognition in the browser and nodejs with tensorflow.js

TypeScriptnpmMIT Licenseface-recognitionjavascript
17.9k3.9k
cmusatyalab/openface

Face recognition with deep neural networks.

LuaApache License 2.0deep-learningface-recognition
cmusatyalab.github.io/openface/
15.4k3.6k
exadel-inc/CompreFace

Leading free and open-source face recognition system

JavaMavenApache License 2.0face-recognitioncomputer-vision
exadel.com/accelerator-showcase/compreface/
8.1k1.1k
boltgolt/howdy

🛡️ Windows Hello™ style facial authentication for Linux

PythonPyPIMIT Licenseface-recognitionubuntu
7.7k405
Shawn-Shan/fawkes

Fawkes, privacy preserving tool against facial recognition systems. More info at https://sandlab.cs.uchicago.edu/fawkes

PythonPyPIBSD 3-Clause "New" or "Revised" Licenseprivacy-protectionprivacy-enhancing-technologies
sandlab.cs.uchicago.edu/fawkes
5.6k507
timesler/facenet-pytorch

Pretrained Pytorch face detection (MTCNN) and facial recognition (InceptionResnet) models

PythonPyPIMIT Licensepytorchresnet
5.2k1k
ThoughtfulDev/EagleEye

Stalk your Friends. Find their Instagram, FB and Twitter Profiles using Image Recognition and Reverse Image Search.

PythonPyPIDo What The F*ck You Want To Public Licensepython3machine-learning
5.2k679
ChanChiChoi/awesome-Face_Recognition

papers about Face Detection; Face Alignment; Face Recognition && Face Identification && Face Verification && Face Representation; Face Reconstruction; Face Tracking; Face Super-Resolution && Face Deblurring; Face Generation && Face Synthesis; Face Transfer; Face Anti-Spoofing; Face Retrieval;

face-detectionface-alignment
4.7k972