Favicon of DeepFace

DeepFace

Open-source Python face recognition library for local or self-hosted use, with TensorFlow and PyTorch support, facial analysis, and an MIT license.

DeepFace is a Python library for developers building face recognition into their own applications. It runs locally or as a self-hosted API, including through Docker. A separate managed API at deepface.dev handles processing on hosted infrastructure. The library is open source under the MIT license.

Its main distinction is a shared interface for models such as VGG-Face, FaceNet, ArcFace, OpenFace, Dlib, SFace, GhostFaceNet and Buffalo_L. It supports TensorFlow and PyTorch. DeepFace handles face detection and alignment alongside recognition, so developers can compare models without building a separate processing pipeline for each one. Detection choices include OpenCV, RetinaFace, MediaPipe and YuNet.

The library can check whether two photos show the same person, find matches in an image collection, or produce face embeddings for use in other systems. Collections can live in local folders, S3 or FTP storage. For database-backed recognition, it can register faces, verify an identity and search stored embeddings using exact or approximate matching. Supported databases include PostgreSQL with pgvector, MongoDB, Neo4j, Qdrant and Milvus.

Facial analysis predicts age, gender, expression and race categories from images. Webcam analysis combines these predictions with face recognition, and an anti-spoofing module assesses whether a face image is real or fake. REST and gRPC APIs expose recognition, analysis, embeddings and database search to web and mobile applications.

Similar to DeepFace