face-recognition
Recognize faces from Python or from the command line
What it is and what it does
face-recognition wraps dlib's deep-learning face recognition model to provide a simple Python interface for detecting faces, extracting facial landmarks, and comparing face encodings to identify individuals. It includes both a Python API for programmatic use and a command-line tool for batch processing folders of images.
The library handles the core tasks of face detection (finding where faces appear in an image), facial feature location (eyes, nose, mouth, chin), and face identification (comparing unknown faces against known encodings to determine matches). It supports parallel processing across multiple CPU cores and allows tolerance tuning to adjust match sensitivity.
Use it for:
- Batch identify people in a folder of photos by comparing against a reference set of known individuals.
- Extract and store face encodings from a database of known people for later comparison and matching.
- Detect all faces in an image and extract their landmark coordinates for facial feature analysis or digital effects.
- Build a real-time face recognition system by processing video frames with parallel CPU processing.
- Adjust recognition sensitivity by tuning tolerance values when similar-looking people cause false matches.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Detects, locates, and identifies faces in images using deep learning, with both Python API and command-line interface for batch processing.
Yes, if you are on macOS or Linux and can install dlib. The package is actively maintained, has no known vulnerabilities, uses a permissive MIT license, and provides a straightforward API backed by a well-regarded deep learning model. Install friction is moderate due to dlib's compilation requirement, but the library itself installs cleanly. Not suitable for Windows without unofficial workarounds.
Install
face-recognition on PyPI
pip
pip install face-recognitionuv
uv add face-recognitionpoetry
poetry add face-recognitionInstalling face-recognition
Before you install
Low friction installation on macOS and Linux; depends on dlib, which requires compilation from source. Windows is not officially supported. The package is actively maintained with recent commits, though the latest release is from 2020.
License in practice
MIT license permits commercial and private use, modification, and distribution with minimal restrictions—suitable for most projects.
Quickstart
pip install face-recognition
import face_recognition
image = face_recognition.load_image_file("photo.jpg")
face_locations = face_recognition.face_locations(image)
dlib must be installed with Python bindings before installing face-recognition; requires macOS or Linux (Windows not officially supported).
Verify before relying
- Whether the 99.38% accuracy figure on Labeled Faces in the Wild benchmark remains current for version 1.3.0.
- Real-world performance and accuracy on diverse face datasets outside the benchmark.
- GPU acceleration requirements and CUDA support status for deep-learning face detection model.
Package facts
| License | MIT license (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 5 — face-recognition-models, Click, dlib, numpy, Pillow |
| Maintenance | actively maintained — 2,367 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 209,145/month — #9,519 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: face_recognition-1.3.0-py2.py3-none-any.whl
Keywords: face_recognition
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
face_recognition_modelsProvides pre-trained deep learning models for…
permissive · top 15,000 on PyPI
deepfaceDeepFace performs face recognition,…
permissive · top 15,000 on PyPI
retina-faceDetects faces in images and extracts facial…
permissive · top 15,000 on PyPI
face-alignmentDetects 2D and 3D facial landmarks from images…
permissive · top 15,000 on PyPI
dlibdlib is a C++ machine learning and computer…
unclear · top 15,000 on PyPI
mtcnnDetects faces and facial landmarks (eyes, nose,…
permissive · top 5,000 on PyPI
insightfaceInsightFace is a Python library for face…
unclear · top 5,000 on PyPI
facexlibFacexlib provides a collection of PyTorch-based…
permissive · top 5,000 on PyPI
facenet-pytorchProvides pretrained PyTorch models for face…
permissive · top 15,000 on PyPI
retinaface-pyDetects and localizes faces in images using a…
permissive · top 15,000 on PyPI