A 14,000-star TensorFlow FaceNet that never left 2018
It implements the FaceNet paper in TensorFlow, complete with a custom MTCNN face aligner and pretrained models that once scored 99.65% on LFW.

What it does This is a ground-up TensorFlow implementation of the 2015 Google FaceNet paper for face recognition and clustering. It learns 128-dimensional face embeddings using an Inception-ResNet-v1 backbone, and it ships with a full preprocessing pipeline—including its own Python/TensorFlow port of the MTCNN face-alignment detector because the authors found Dlib missed too many hard examples like partial occlusions.
The interesting bit The project is essentially a complete research reproduction frozen in amber: it does not just dump a model, but provides training code, alignment logic, and two high-performing pretrained checkpoints (one trained on VGGFace2, one on CASIA-WebFace). The authors also note that fixed image standardization is required to reproduce the published LFW numbers—a subtle but important detail.
Key highlights
- Implements the full FaceNet embedding pipeline in TensorFlow, inspired by the earlier OpenFace project.
- Includes a custom TensorFlow MTCNN implementation for face detection and alignment; the authors note it performs very similarly to the original Matlab/Caffe reference.
- Provides pretrained Inception-ResNet-v1 models, with the best achieving 0.9965 LFW accuracy using fixed image standardization.
- Supports training from scratch using softmax loss or triplet loss on standard datasets like CASIA-WebFace and VGGFace2.
Caveats
- The codebase is locked to TensorFlow r1.7 and tested only on Ubuntu 14.04 with Python 2.7/3.5, making it a challenge to run on modern stacks without significant archaeology.
- The last meaningful update was in April 2018, so expect dependency drift and no active maintenance.
- The bundled MTCNN port does not produce identical results to the original Matlab/Caffe implementation, though performance is said to be very similar.
Verdict Worth a look if you are studying the FaceNet paper or need a well-documented, end-to-end historical reference for face-recognition pipelines. Skip it if you want a drop-in, modern, maintained library for production use today.
Frequently asked
- What is davidsandberg/facenet?
- It implements the FaceNet paper in TensorFlow, complete with a custom MTCNN face aligner and pretrained models that once scored 99.65% on LFW.
- Is facenet open source?
- Yes — davidsandberg/facenet is open source, released under the MIT license.
- What language is facenet written in?
- davidsandberg/facenet is primarily written in Python.
- How popular is facenet?
- davidsandberg/facenet has 14.3k stars on GitHub.
- Where can I find facenet?
- davidsandberg/facenet is on GitHub at https://github.com/davidsandberg/facenet.