deepface
A Lightweight Face Recognition and Facial Attribute Analysis Framework (Age, Gender, Emotion, Race) for Python
Decision gist · record as of 2026-08-14
Yes, if you need face recognition or facial attribute analysis and can accept the substantial dependency footprint (TensorFlow, Keras, OpenCV). The package is actively maintained, has no known vulnerabilities, uses a permissive MIT license, and abstracts away significant complexity. Install it if your use case justifies the disk and memory overhead; avoid it if you need a lightweight, minimal-dependency solution or are uncertain whether you need deep learning-based face analysis.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires TensorFlow and Keras; pre-trained models are downloaded on first use.
- OpenCV and Pillow need system libraries for image handling.
- Low install friction with a pure Python wheel.
License · maintenance · safety
MIT (permissive) — MIT license permits commercial and private use with minimal restrictions, requiring only attribution and inclusion of the license notice.
last release 2026-05-09 (97 days) · last repo commit 2026-08-14 · 23,282 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 587,559 downloads/mo, #5,874 on PyPI
Alternatives
Verify before relying
pip install deepface
from deepface import DeepFace
# Face verification
result = DeepFace.verify(img1_path="img1.jpg", img2_path="img2.jpg")
# Facial attribute analysis
objs = DeepFace.analyze(img_path="img.jpg", actions=['age', 'gender', 'emotion', 'race'])- Whether pre-trained model downloads are cached or re-downloaded on each environment setup
- GPU acceleration support and CUDA/cuDNN requirements for production deployments
- Latency and throughput characteristics for real-time streaming on typical hardware
- Accuracy metrics for the supported models beyond the age MAE and gender accuracy cited in the description
What it is and what it does
DeepFace is a Python framework that wraps multiple state-of-the-art face recognition and analysis models (VGG-Face, FaceNet, OpenFace, DeepFace, DeepID, ArcFace, Dlib, SFace, GhostFaceNet, Buffalo_L) into a unified API. It handles the full face recognition pipeline—detection, alignment, normalization, representation, and verification—internally, so you can call high-level functions like `verify()`, `find()`, or `analyze()` with minimal setup.
The package supports three main workflows: one-to-one face verification (comparing two images), one-to-many face recognition (searching a database of embeddings stored in PostgreSQL, MongoDB, Neo4j, Pinecone, pgvector, or Weaviate), and facial attribute analysis (predicting age, gender, emotion, and race from images). It also includes real-time video streaming for continuous analysis. With 18 runtime dependencies including TensorFlow, Keras, OpenCV, and Flask, it brings substantial computational machinery but abstracts away the complexity of model selection and pipeline orchestration.
Use it for
- Verify whether two photos belong to the same person for identity confirmation or fraud detection workflows.
- Search a database of employee or customer photos to identify individuals in new images for security or CRM applications.
- Analyze facial attributes (age, gender, emotion, race) in batch or real-time video for demographic insights or sentiment analysis.
- Build a real-time video stream analyzer that continuously detects and identifies faces from a webcam feed.
- Register and index face embeddings in a vector database for large-scale face recognition at scale.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need face recognition or facial attribute analysis and can accept the substantial dependency footprint (TensorFlow, Keras, OpenCV).
The package is actively maintained, has no known vulnerabilities, uses a permissive MIT license, and abstracts away significant complexity. Install it if your use case justifies the disk and memory overhead; avoid it if you need a lightweight, minimal-dependency solution or are uncertain whether you need deep learning-based face analysis.
Install
deepface on PyPI
Before you install
Low install friction with a pure Python wheel. Depends on 18 runtime packages including TensorFlow, Keras, and OpenCV, which may require significant disk space and compilation time on some systems. The project is actively maintained with recent commits and high GitHub visibility.
Requires TensorFlow and Keras; pre-trained models are downloaded on first use. OpenCV and Pillow need system libraries for image handling.
License in practice
MIT license permits commercial and private use with minimal restrictions, requiring only attribution and inclusion of the license notice.
Quickstart
pip install deepface
from deepface import DeepFace
# Face verification
result = DeepFace.verify(img1_path="img1.jpg", img2_path="img2.jpg")
# Facial attribute analysis
objs = DeepFace.analyze(img_path="img.jpg", actions=['age', 'gender', 'emotion', 'race'])
Verify before relying
- Whether pre-trained model downloads are cached or re-downloaded on each environment setup
- GPU acceleration support and CUDA/cuDNN requirements for production deployments
- Latency and throughput characteristics for real-time streaming on typical hardware
- Accuracy metrics for the supported models beyond the age MAE and gender accuracy cited in the description
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.7 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 18 packagesrequestsnumpypandasgdowntqdmPillowopencv-pythontensorflowkerasFlaskflask-corsmtcnnretina-facefiregunicornlightphelightdsapython-dotenv |
| Maintenance | Actively maintained 97 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 587,559 / month, #5,874 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | License :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3 |
Evidence: deepface-0.0.100-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “facial attribute analysis”
- deepfaceDeepFace performs face recognition, verification, and facial…
- insightfaceInsightFace is a Python library for face detection, recognition,…
- face-alignmentDetects 2D and 3D facial landmarks from images using deep learning,…
Give your agent the search over MCP, or paste the wish link into any chat.
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to call 100+ LLM providers (OpenAI, Anthropic, Gemini, Bedrock, Azure, and others) using OpenAI-compatible API format, available as both a Python SDK and a self-hosted AI Gateway proxy server.
Install it if you need to work with multiple LLM providers or want to centralize LLM routing in your organization.
Client library and CLI tool for downloading, uploading, and managing models, datasets, and repositories on the Hugging Face Hub platform.
Install it if you work with Hugging Face Hub models or datasets.
LangChain provides a framework for building agents and LLM-powered applications by composing language models, tools, and memory through a unified API that abstracts over multiple model providers.
hf-xet provides chunk-based deduplication and efficient file transfer for the Hugging Face Hub, enabling faster uploads and downloads of large files with local disk caching.
Tokenizers converts raw text into token sequences for NLP models, with support for training custom vocabularies and using pre-built tokenizers (BPE, WordPiece) optimized for speed via Rust.
Transformers provides a unified framework for loading, fine-tuning, and running state-of-the-art pretrained models across text, vision, audio, video, and multimodal tasks using PyTorch, JAX, or TensorFlow.
Install it if you need to run or train any transformer-based model for NLP, vision, audio, or multimodal tasks.
See also insightface · retina-face · face-recognition · face_recognition_models · face-alignment · facenet-pytorch · mtcnn · facexlib · Resemblyzer · gender-guesser