Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Pretrained Pytorch face detection (MTCNN) and facial recognition (InceptionResnet) models
| Date | Stars |
|---|---|
| 2026-07-30 | 5157 |
| 2026-08-10 | 5160 |
| 2026-08-18 | 5162 |
| 2026-08-21 | 5161 |
| 2026-08-24 | 5162 |
| 2026-08-29 | 5163 |
| 2026-08-30 | 5164 |
| 2026-08-31 | 5163 |
| 2026-09-01 | 5164 |
| 2026-09-06 | 5165 |
| 2026-09-09 | 5166 |
| 2026-09-10 | 5167 |
| 2026-09-13 | 5168 |
| 2026-09-17 | 5169 |
| 2026-09-21 | 5168 |
| 2026-09-23 | 5167 |
| 2026-09-26 | 5168 |
| 2026-09-29 | 5168 |
| 2026-10-01 | 5169 |
| 2026-10-08 | 5168 |
| 2026-10-09 | 5170 |
| 2026-10-10 | 5172 |
| 2026-10-21 | 5171 |
| 2026-10-25 | 5173 |
| 2026-10-27 | 5172 |
| 2026-10-29 | 5174 |
| 2026-10-30 | 5176 |
| 2026-11-01 | 5177 |
| 2026-11-02 | 5176 |
| 2026-11-04 | 5177 |
Today
+1 stars today
This week
+5 stars this week
This month
+8 stars this month
Momentum
0.0
growth rate 0.10%/day
# Face Recognition Using Pytorch
*You can also read a translated version of this file [in Chinese 简体中文版](README_cn.md).*
[](https://pepy.tech/project/facenet-pytorch)
[](https://codecov.io/gh/timesler/facenet-pytorch)
This is a repository for Inception Resnet (V1) models in pytorch, pretrained on VGGFace2 and CASIA-Webface.
Pytorch model weights were initialized using parameters ported from David Sandberg's [tensorflow facenet repo](https://github.com/davidsandberg/facenet).
Also included in this repo is an efficient pytorch implementation of MTCNN for face detection prior to inference. These models are also pretrained. To our knowledge, this is the fastest MTCNN implementation available.
## Table of contents
* [Table of contents](#table-of-contents)
* [Quick start](#quick-start)
* [Pretrained models](#pretrained-models)
* [Example notebooks](#example-notebooks)
+ [*Complete detection and recognition pipeline*](#complete-detection-and-recognition-pipeline)
+ [*Face tracking in video streams*](#face-tracking-in-video-streams)
+ [*Finetuning pretrained models with new data*](#finetuning-pretrained-models-with-new-data)
+ [*Guide to MTCNN in facenet-pytorch*](#guide-to-mtcnn-in-facenet-pytorch)
+ [*Performance comparison of face detection packages*](#performance-comparison-of-face-detection-packages)
+ [*The FastMTCNN algorithm*](#the-fastmtcnn-algorithm)
* [Running with docker](#running-with-docker)
* [Use this repo in your own git project](#use-this-repo-in-your-own-git-project)
* [Conversion of parameters from Tensorflow to Pytorch](#conversion-of-parameters-from-tensorflow-to-pytorch)
* [References](#references)
## Quick start
1. Install:
```bash
# With pip:
pip install facenet-pytorch
# or clone this repo, removing the '-' to allow python imports:
git clone https://github.com/timesler/facenet-pytorch.git facenet_pytorch
# or use a docker container (see https://github.com/timesler/docker-jupyter-dl-gpu):
docker run -it --rm timesler/jupyter-dl-gpu pip install facenet-pytorch && ipython
```
1. In python, import facenet-pytorch and instantiate models:
```python
from facenet_pytorch import MTCNN, InceptionResnetV1
# If required, create a face detection pipeline using MTCNN:
mtcnn = MTCNN(image_size=<image_size>, margin=<margin>)
# Create an inception resnet (in eval mode):
resnet = InceptionResnetV1(pretrained='vggface2').eval()
```
1. Process an image:
```python
from PIL import Image
img = Image.open(<image path>)
# Get cropped and prewhitened image tensor
img_cropped = mtcnn(img, save_path=<optional save path>)
# Calculate embedding (unsqueeze to add batch dimension)
img_embedding = resnet(img_cropped.unsqueeze(0))
# Or, if using for VGGFace2 classification
resnet.classify = True
img_probs = resnet(img_cropped.unsqueeze(0))
```
See `help(MTCNN)` and `help(InceptionResnetV1)` for usage and implementation details.
## Pretrained models
See: [models/inception_resnet_v1.py](models/inception_resnet_v1.py)
The following models have been ported to pytorch (with links to download pytorch state_dict's):
|Model name|LFW accuracy (as listed [here](https://github.com/davidsandberg/facenet))|Training dataset|
| :- | :-: | -: |
|[20180408-102900](https://github.com/timesler/facenet-pytorch/releases/download/v2.2.9/20180408-102900-casia-webface.pt) (111MB)|0.9905|CASIA-Webface|
|[20180402-114759](https://github.com/timesler/facenet-pytorch/releases/download/v2.2.9/20180402-114759-vggface2.pt) (107MB)|0.9965|VGGFace2|
There is no need to manually download the pretrained state_dict's; they are downloaded automatically on model instantiation and cached for future use in the torch cache. To use an Inception Resnet (V1) model foExcerpt of 11,357 characters
Read on GitHub229
5
2
2
1
1
Jose · Canada
1
1
Nikhil Modem · Xelix · United Kingdom
1
1
1
Matthijs van der Burgh · @tue-robotics @VBTI-development · Netherlands
1
1
1
Ruijun Gao · @microsoft, @twtstudio · China
1
1
Would you bet a product on this? Bounded 0–100 and slow moving.
matched fp:0e836bd1fb72fe6e, topic:face-recognition, readme:face recognition
matched fp:0e836bd1fb72fe6e, topic:pytorch