skillfed

facenet-pytorch

Pretrained Pytorch face detection and recognition models

facenet-pytorch v2.6.0 154.9K downloads/30d#10,839 on PyPI5,160
Permissive license AGING released

What it is and what it does

facenet-pytorch wraps pretrained Inception ResNet V1 models (trained on VGGFace2 and CASIA-Webface datasets) and an efficient MTCNN face detector into a PyTorch package. The models are ported from an external TensorFlow implementation and automatically download and cache their weights on first use. You use it to detect faces in images, extract 512-dimensional face embeddings for recognition tasks, or classify faces into known identities.

The package handles the full pipeline: MTCNN crops and aligns faces from raw images, then Inception ResNet V1 generates embeddings or classification logits. Both models are pretrained and ready to use without training. You can also finetune the models on new data or use the embeddings with clustering or distance metrics to identify faces. The package includes examples for video face tracking, batch processing, and performance comparisons.

Use it for:

  • Extract face embeddings from images for identity verification or clustering unknown faces.
  • Detect and locate faces in images or video frames using MTCNN before downstream processing.
  • Build a face recognition system by comparing embeddings against a known face database.
  • Finetune pretrained models on custom face datasets for domain-specific recognition tasks.
  • Track faces across video frames using MTCNN's detection output.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides pretrained PyTorch models for face detection using MTCNN and face recognition using Inception ResNet V1, with automatic model downloading and caching.

Yes, with conditions. The package is well-maintained for its scope (5160 GitHub stars, low install friction, no known vulnerabilities), but maintenance is aging—the last release was April 2024. Install it if you need pretrained face detection and recognition models and can accept that bug fixes or compatibility updates may lag behind new PyTorch releases. For production systems requiring active support, verify compatibility with your PyTorch version first.

Install

facenet-pytorch on PyPI

pip

pip install facenet-pytorch

uv

uv add facenet-pytorch

poetry

poetry add facenet-pytorch

Installing facenet-pytorch

Before you install

Low friction install with a pure Python wheel. Maintenance is aging—last release was April 2024 with last commit September 2025, though the repository remains active with 5160 stars and is not archived.

License in practice

Licensed under MIT (permissive), allowing commercial and private use with minimal restrictions.

Quickstart

pip install facenet-pytorch

from facenet_pytorch import MTCNN, InceptionResnetV1

mtcnn = MTCNN(image_size=160)
resnet = InceptionResnetV1(pretrained='vggface2').eval()

img_cropped = mtcnn(img)
img_embedding = resnet(img_cropped.unsqueeze(0))

Requires torch and torchvision; pretrained models are downloaded automatically on first use and cached.

Verify before relying

  • Compatibility with PyTorch versions released after April 2024.
  • GPU memory requirements for batch processing and model inference.
  • Whether the package supports modern Python versions beyond what classifiers declare.

Package facts

License not declared (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies 6 — numpy, Pillow, requests, torch, torchvision, tqdm
Maintenance aging — 837 days since the last release
Last repo commit
First released
Downloads 154,911/month — #10,839 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: facenet_pytorch-2.6.0-py3-none-any.whl

License :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3

Tags

face detection pytorchface recognition embeddingmtcnn face detectioninception resnet v1facial recognition neural networkface embedding extractionpretrained face models pytorch
face-detectionface-recognitioncomputer-vision

More Artificial Intelligence packages

Further reading