
FaceNet
A TensorFlow implementation of the FaceNet face recognition model, with pretrained weights.
- Stars
- 14.4k
- Forks
- 4.8k
- Licence
- MIT
- Language
- Python
- Last update
- 3.3 years ago
- Type
- AI model / agent
No commits in over a year — check for forks or alternatives before adopting.
What it is
This project is a TensorFlow version of FaceNet, a method that turns a photo of a face into a list of numbers (an embedding) so that photos of the same person end up close together. It includes training code, face alignment using MTCNN, and pretrained models reported to reach about 99% accuracy on the LFW benchmark. People use it as a starting point for building or testing face recognition systems.
- Compute face embeddings for a set of photos and compare how similar two faces are
- Evaluate a pretrained model on the LFW benchmark using validate_on_lfw.py
- Train a softmax classifier on your own labeled face images (per the README's news entry and wiki links)
- Run MTCNN-based face alignment as a preprocessing step before recognition
Great for
- Researchers reproducing the FaceNet paper with TensorFlow
- Developers who want pretrained face embedding models to build on
- Engineers training a face classifier on their own image set, following the linked wiki
- Students studying how face recognition models are trained and evaluated
Not ideal for
- People who need a plug-and-play face unlock or photo tagging app, since the README describes research code, not an end-user product
- Teams needing current TensorFlow versions, because the README says it was tested only with TensorFlow r1.7, Python 2.7 and 3.5
- Anyone who needs guidance on legal or ethical use of face data, which the README does not cover beyond crediting dataset providers
How to get it
- 1
Clone and build from source
You'll need: Python 2.7 or 3.5 (per README compatibility note) · TensorFlow r1.7 (per README compatibility note)
Clone the repository
git clone https://github.com/davidsandberg/facenet.git - 2
Run it
- Clone the repository and set up a Python environment matching the README's stated versions
- Download a pretrained model from the Google Drive links in the README
- Run validate_on_lfw.py with --use_fixed_image_standardization to check accuracy on LFW
- Follow the wiki pages linked in the README to train or classify your own images
- 3
Get the most out of it
- Use the --use_fixed_image_standardization option, which the README says the models require
- Read the linked wiki pages for training on CASIA-WebFace and VGGFace2 datasets
- Use the MTCNN alignment code in src/align for preprocessing images before recognition
- Start from the VGGFace2-trained model, which the README describes as the best performing
Downloads
Strengths
- Based on a well-known published paper (FaceNet), so the approach is documented and widely cited
- Ships pretrained models with reported LFW accuracy (0.9905 and 0.9965) and their training datasets
- Includes training scripts, face alignment code and test cases in the repository
Trade-offs
- The README states compatibility only with TensorFlow r1.7, Ubuntu 14.04, and Python 2.7/3.5, which are very old, so setup on modern systems may be difficult
- Last code push was 2023-07-24 and there is no formal release, so maintenance status is unclear
- Some README sections are incomplete or point to external wiki pages for key details
How it compares
| Project | Stars | Type | Level | Updated | Best for |
|---|---|---|---|---|---|
| facenet (this) | 14.4k | AI model / agent | advanced | 3.3 years ago | Researchers reproducing the FaceNet paper with TensorFlow |
| deepface | 23.6k | Library | intermediate | 6 days ago | Python developers prototyping face verification or face search |
| face-api.js | 18k | Library | intermediate | 2.8 years ago | Web developers adding face detection to a browser page |
| face_recognition | 56.9k | Library | intermediate | 4 months ago | Python developers prototyping photo sorting or face matching |
| ai-engineering-from-scratch | 76.3k | Learning resource | intermediate | 4 days ago | Students who want to understand how LLMs, retrieval, and agents work internally |
| AI-For-Beginners | 70.5k | Learning resource | beginner | 13 days ago | Beginners who want a structured, self-paced introduction to AI |
Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.