serengil/deepface
52.5
Adequate · 16 November 2026
24.2k
lines of production code
Python
primary language
5
measurements over time
What this system is
Features
Added Docker Compose configurations for local development and testing
New Docker Compose files have been added to facilitate local setup of backend services. This includes a standard configuration for PostgreSQL and pgvector, a separate configuration for S3-compatible object storage (using SeaweedFS) and FTP, and an integration script to launch these services. These changes enable users to run the application against local database and storage backends for development and testing purposes.
docker · high confidence
Added LightGBM and XGBoost boosting experiment notebooks and model artifacts
The boosted directory now includes two new Jupyter notebooks, Perform-Boosting-Experiments-LightGBM.ipynb and Perform-Boosting-Experiments-XGBoost.ipynb, which provide scripts to run face recognition experiments on the LFW dataset using DeepFace and gradient boosting models. Additionally, a trained LightGBM model file (boosted\_lightface\_7.txt) has been added to the models subdirectory, containing the serialized tree structures and feature importance data for the 'lightface' configuration.
boosted · high confidence
Added deployment and release automation scripts
New shell scripts have been added to streamline the project's operational workflows. The \service.sh\ script allows users to start the API using Gunicorn for production environments, binding to port 5005. The \dockerize.sh\ script automates building the Docker image and running the container, optionally loading environment variables from a \.env\ file. Additionally, \push-release.sh\ simplifies publishing new versions to PyPI by building the distribution packages and uploading them via Twine.
scripts · high confidence
DeepFace modules restructured into a modular architecture with new capabilities
The deepface codebase has been reorganized into distinct modules (detection, demography, representation, verification, datastore, filestore, modeling, preprocessing, normalization, encryption, and exceptions), replacing the previous monolithic structure. This change introduces support for multiple database backends (Postgres, Mongo, Weaviate, Neo4j, pgvector, Pinecone, Milvus, Qdrant) and file stores (local, S3, FTP) via the new datastore and filestore modules. It also adds new face detection models (yolov11n/m/l, yolov12n/s/m/l, centerface), a new facial recognition model (Buffalo\_L), and an encryption module for embedding security using LightPHE. The detection module now supports a max\_faces parameter and improved landmark validation, while the demography module handles facial attribute analysis. The modeling module provides a unified interface for lazy-loading models across different backend engines (TensorFlow, PyTorch, ONNX).
deepface/modules · high confidence
DeepFace v0.0.102: Modular backend installation and CLI entry point
The package version is updated to 0.0.102. Installation is now modular, allowing users to install specific deep learning backends (TensorFlow, PyTorch, or ONNX) via extras (e.g., \pip install deepface\[tensorflow\]\) rather than forcing all dependencies. A new command-line interface entry point (\deepface\) is added, and the Dockerfile is updated to support this structure with a new entrypoint script.
(repo-wide) · high confidence
Demography and facial recognition models now support ONNX and PyTorch backends
Users can now run facial attribute analysis (age, gender, race, emotion) and facial recognition using ONNX Runtime or PyTorch, in addition to the existing TensorFlow backend. This change introduces new model implementations for these frameworks, allowing for potentially faster inference and reduced dependency on TensorFlow, while maintaining the same prediction outputs and API.
_deepface/models/facial\recognition · high confidence
Face anti-spoofing now supports PyTorch and ONNX backends
The face anti-spoofing module in \deepface/models/spoofing\ has been expanded to support PyTorch and ONNX inference in addition to the existing TensorFlow backend. This change introduces new implementation files (\pytorch/FasNet.py\, \onnx/FasNet.py\, and their respective backbones) alongside a shared utility module (\FasNetUtils.py\) for image cropping, allowing users to choose the runtime that best fits their environment or performance requirements.
deepface/models/spoofing · high confidence
New benchmarking notebooks and documentation for DeepFace experiments
Added \Perform-Experiments.ipynb\ and \Evaluate-Results.ipynb\ to the \benchmarks\ directory, providing users with reproducible scripts to run facial recognition experiments on the LFW dataset and analyze the results. The \benchmarks/README.md\ was also added to document the experimental setup, display performance matrices across various models (e.g., Facenet, VGG-Face) and detectors (e.g., retinaface, mtcnn), and include citation information.
benchmarks · high confidence
New gRPC API and startup model loading
The API now exposes a gRPC interface mirroring the existing REST endpoints (Represent, Verify, Analyze, Register, Search, BuildIndex), allowing clients to use the protocol buffer definitions in \deepface/api/proto/deepface.proto\. Additionally, the application can now pre-load specified face recognition and detection models at startup via configuration, reducing latency for the first request after deployment.
deepface/api/src · high confidence
Pluggable multi-backend database architecture for embeddings
DeepFace now supports storing and searching face embeddings across a wide range of external databases through a unified, pluggable client architecture. The \deepface/modules/database\ module introduces a \Database\ abstract base class and a dynamic inventory (\inventory.py\) that registers specific backends: PostgreSQL (standard and pgvector), MongoDB, Neo4j, Weaviate, Pinecone, Milvus, and Qdrant. Users can now choose the storage engine that best fits their infrastructure, with each backend handling its own schema initialization, vector indexing, and distance metric conversions (e.g., converting Milvus or Pinecone scores to DeepFace distance units) automatically. Also in this area: 6 commits (0 fixes) modifying deepface/modules/database.
deepface/modules/database · medium confidence · unverified
Removals
Removal of legacy Keras-based facial recognition models
The legacy standalone model implementations for Facenet, OpenFace, and VGGFace have been removed from the \deepface/basemodels\ directory. These files, which previously defined model architectures using older Keras APIs (such as \Convolution2D\ and \Sequential\), are no longer part of the codebase, indicating a shift toward a new model structure or backend.
deepface/basemodels · high confidence
Behavioural changes
1 commit (0 fixes) modifying deepface/models/face\_detection/pytorch, deepface/models/face\_detection/tf
A change to existing behaviour in deepface/models/face\_detection/pytorch, deepface/models/face\_detection/tf — 1 commit, 5 files: “run mtcnn on tensorflow, pytorch and onnx, group detectors by engine (\#1681)” (refs \#1681).
_deepface/models/face\_detection/pytorch, deepface/models/face\detection/tf · medium confidence · unverified
1 commit (0 fixes) modifying experiments
A change to existing behaviour in experiments — 1 commit, 4 files: “DeepFace Backend Engine Benchmark (\#1735)” (refs \#1735). Also in this area: Added experiment notebook for distance-to-confidence calibration.
experiments · medium confidence · unverified
3 commits (0 fixes) modifying deepface/api/src/modules/auth
A change to existing behaviour in deepface/api/src/modules/auth — 3 commits, 2 files: “bearer token support added (\#1558)”; “simplify auth service (\#1563)”; “Use the already decoded query image in find (\#1701)” (refs \#1558, \#1563, \#1701).
deepface/api/src/modules/auth · medium confidence · unverified
3 commits (0 fixes) modifying deepface/models/face\_detection
A change to existing behaviour in deepface/models/face\_detection — 3 commits, 1 file: “summary for detectors routings”; “models refactored”; “run yolo face detectors on onnx as well as pytorch (\#1731)” (refs \#1731).
_deepface/models/face\detection · medium confidence · unverified
3 commits (0 fixes) modifying deepface/models/face\_detection/opencv
A change to existing behaviour in deepface/models/face\_detection/opencv — 3 commits, 3 files: “run mtcnn on tensorflow, pytorch and onnx, group detectors by engine (\#1681)”; “Serialize input and inference on shared SSD networks (\#1733)”; “Serialize concurrent calls to shared native face detectors (\#1756)” (refs \#1681, \#1733, \#1756).
_deepface/models/face\detection/opencv · medium confidence · unverified
7 commits (0 fixes) modifying deepface
A change to existing behaviour in deepface — 7 commits, 5 files: “Honor anti-spoofing when face detection is skipped (\#1738)”; “Preserve mixed-case image paths during registration (\#1754)”; “Serialize concurrent calls to shared native face detectors (\#1756)”; and 4 more (refs \#1738, \#1754, \#1756, \#1757, \#1758, …).
_deepface/models/face\_detection/external, deepface/models/face\detection/onnx · medium confidence · unverified
API configuration and structural updates
The API module has been relocated to the deepface/api directory to improve testability. A new .env.example file documents configuration options for database selection (Postgres, Mongo, Weaviate), including specific Weaviate settings for tenant isolation and quantization, as well as environment variables for pre-loading face recognition and detection models to reduce initial request latency and enabling bearer token authentication.
deepface/api · high confidence
API restructured with Bearer token authentication and flexible image input
The DeepFace API has been reorganized into a modular structure (auth, core) and now supports Bearer token authentication via the Authorization header, returning 401 errors for invalid or missing tokens. Image inputs for endpoints like /represent, /verify, and /analyze can now be provided as base64 strings, file paths, or URLs within JSON or multipart/form-data requests, replacing stricter previous parsing. Additionally, the /represent endpoint accepts a max\_faces argument to limit results, and all endpoints now include detailed exception logging and traceback information in error responses to aid debugging.
deepface/api/src/modules/core · high confidence
Configurable confidence normalization and thresholds for face models
The \deepface/config\ module now provides structured configuration files for confidence score normalization and decision thresholds across supported face recognition models (VGG-Face, Facenet, ArcFace, etc.). Users benefit from empirically derived min-max values and distance thresholds for various metrics (cosine, euclidean, angular), allowing for more accurate and consistent similarity assessments and match decisions without hard-coded constants in the core logic.
deepface/config · high confidence
DeepFace refactors core utilities and introduces multi-backend support
The library has been restructured to support TensorFlow, PyTorch, and ONNX backends, allowing users to select their preferred engine via the DEEPFACE\_BACKEND\_ENGINE environment variable or automatic detection. This change introduces new utility modules in deepface/commons for backend selection, weight management, image loading (supporting paths, URLs, and file objects), and a singleton logger, while removing legacy functions and the old distance calculation module.
deepface/commons · high confidence
Introduces dependency injection container and environment-based configuration
The application now uses a dependency injection container to manage services like authentication, initialized with configuration values read from environment variables. This change allows users to configure the database type (defaulting to postgres), connection details, and face recognition/detection models via environment variables (e.g., DEEPFACE\_DATABASE\_TYPE, DEEPFACE\_CONNECTION\_DETAILS, DEEPFACE\_AUTH\_TOKEN), replacing previous hardcoded or implicit configuration methods.
deepface/api/src/dependencies · high confidence
Introduction of abstract model interfaces for facial recognition, detection, and demography
The library now enforces a structured object-oriented design by introducing abstract base classes (ABCs) for core model types: FacialRecognition, Detector, and Demography. Users benefit from a more consistent and extensible API where specific model implementations must adhere to defined contracts, such as the \forward\ method for facial recognition and \detect\_faces\ for detectors. The \Detector\ interface also standardizes output via new data classes (\FacialAreaRegion\, \DetectedFace\), ensuring uniform return structures for face metadata including coordinates, confidence, and key points. This refactoring lays the groundwork for better modularity and easier integration of new backends or models while maintaining backward compatibility through the existing high-level functions.
deepface/models · high confidence
Major API restructuring and deprecation warning for backend installation
The DeepFace library has undergone a significant internal refactor, moving logic from the monolithic DeepFace.py into modular components (detection, representation, verification, etc.) and introducing a global \build\_model\ function. A new deprecation warning alerts users that installing \deepface\ without specifying a backend (e.g., \\[tensorflow\]\, \\[pytorch\]\, or \\[onnx\]\) will no longer work in future major releases. The public API now explicitly supports \IO\[bytes\]\ file objects and pre-calculated embeddings as inputs for verification, and the \verify\ function returns additional metadata including confidence scores and facial areas.
deepface · high confidence
Test coverage
15 commits adding/updating tests in tests; Expanded integration and unit test coverage for storage backends and model validation; Removal of legacy unit test script.
Dependencies
Split dependencies into modular requirement files
The project's dependency management has been restructured from a single list into eight modular requirement files (requirements\_base.txt, requirements\_api.txt, requirements\_cli.txt, requirements\_grpc.txt, requirements\_pandas.txt, requirements\_pytorch.txt, requirements\_tf.txt, and requirements\_additional.txt). This change allows users to install only the specific components they need, such as separating the base runtime (requests, numpy, opencv-contrib-python-headless, onnxruntime) from optional features like API support (Flask, gunicorn), gRPC services (grpcio, grpcio-tools), PyTorch backend (torch), TensorFlow backend (tensorflow, keras, mtcnn), and additional AI models (mediapipe, dlib, ultralytics, facenet-pytorch, insightface).
(dependencies) · high confidence
Housekeeping
Added empty \_\_init\_\_.py to modules directory
An empty \_\init\\_.py file was added to the deepface/api/src/modules directory. This change ensures the directory is recognized as a Python package, allowing its contents to be imported as a module.
deepface/api/src/modules · high confidence
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 52.0 → 52.5 (+0.5)
- Rubric changed (rubric-2026.11.2 → rubric-2026.11.4) — scores are not directly comparable.
Lenses
- Code Health 69.0 → 63.2 (-5.8)
- Architecture 85.4 → 96.8 (+11.4)
- Maturity 60.6 → 68.8 (+8.2)
- Readiness 35.3 → 33.9 (-1.4)
- Security 74.8 → 74.8 (0.0)
Resolved (19)
- Duplicated block (10 lines × 73) (deepface/models/facial_recognition/tf/Facenet.py)
- Duplicated block (12 lines × 2) (deepface/models/facial_recognition/tf/Facenet.py)
- Duplicated block (12 lines × 3) (deepface/api/src/modules/core/routes.py)
- Duplicated block (14 lines × 3) (deepface/api/src/modules/core/routes.py)
- Duplicated block (15 lines × 32) (deepface/models/facial_recognition/tf/Facenet.py)
- Duplicated block (16 lines × 2) (deepface/api/src/modules/core/routes.py)
- Duplicated block (17 lines × 16) (deepface/models/facial_recognition/tf/Facenet.py)
- Duplicated block (3–26 lines × 3) (deepface/models/facial_recognition/tf/OpenFace.py)
- Duplicated block (3–8 lines × 4) (deepface/models/facial_recognition/tf/OpenFace.py)
- Duplicated block (5 lines × 6) (deepface/models/facial_recognition/tf/Facenet.py)
- Duplicated block (7–9 lines × 2) (deepface/modules/database/milvus.py)
- Duplicated block (9 lines × 2) (deepface/models/facial_recognition/tf/OpenFace.py)
- Edited copy of a member (10 corresponding lines) (deepface/models/spoofing/pytorch/FasNetBackbone.py)
- Members sharing a duplicated core (9 members, 50+ identical tokens) (deepface/modules/database/cassandra.py)
- No ADRs found
- Off-boarding risk: anonymized user #1
- Projects may be oversized for their cohesion
- datastore.search (cognitive 84) (deepface/modules/datastore.py)
- datastore.search (cyclomatic 43) (deepface/modules/datastore.py)
New (46)
- Change coupling: Dlib.py ↔ OpenCv.py (deepface/models/face_detection/external/Dlib.py)
- Change-coupling hub: MtCnn.py → Dlib.py, RetinaFace.py, OpenCv.py (deepface/models/face_detection/tf/MtCnn.py)
- Duplicated block (11 lines × 2) (deepface/models/face_detection/onnx/MtCnn.py)
- Duplicated block (13 lines × 3) (deepface/api/src/modules/core/routes.py)
- Duplicated block (15 lines × 3) (deepface/api/src/modules/core/routes.py)
- Duplicated block (18 lines × 2) (deepface/api/src/modules/core/routes.py)
- Duplicated block (5 lines × 2) (deepface/models/face_detection/onnx/MtCnn.py)
- Duplicated block (8 lines × 2) (deepface/models/face_detection/onnx/Yolo.py)
- Edited copies of one member (3 members, 11+ corresponding lines) (deepface/models/facial_recognition/pytorch/Facenet.py)
- Edited copies of one member (3 members, 12+ corresponding lines) (deepface/api/src/grpc_server.py)
- Edited copies of one member (3 members, 24+ corresponding lines) (deepface/models/face_detection/onnx/MtCnn.py)
- Edited copies of one member (4 members, 2+ corresponding lines) (deepface/models/facial_recognition/pytorch/OpenFace.py)
- Edited copies of one member (4 members, 28+ corresponding lines) (deepface/modules/database/mssql.py)
- Edited copies of one member (4 members, 29+ corresponding lines) (deepface/modules/database/mssql.py)
- Edited copies of one member (4 members, 3+ corresponding lines) (deepface/models/demography/pytorch/Age.py)
- Edited copies of one member (5 members, 15+ corresponding lines) (deepface/api/src/modules/core/service.py)
- Edited copies of one member (5 members, 27+ corresponding lines) (deepface/modules/database/db2.py)
- Edited copies of one member (6 members, 31+ corresponding lines) (deepface/modules/database/db2.py)
- Edited copy of a member (10 corresponding lines) (deepface/models/spoofing/pytorch/FasNetBackbone.py)
- Edited copy of a member (12 corresponding lines) (deepface/models/facial_recognition/pytorch/Facenet.py)
- …and 26 more
Changes since last survey
- 48 commits — 46 feature/other, 2 fixes
By area
- deepface/modules — 26 commits
- deepface/models — 7 commits
- deepface/commons — 5 commits
- (root) — 3 commits
- .github/workflows — 3 commits
- tests/unit — 2 commits
- deepface/api — 1 commit
- experiments/engines — 1 commit
Notable commits
- fix: Fix FTP image paths containing reserved URI characters (#1678)
- fix: fix broken gdown test and increase version1
- change: run mtcnn on tensorflow, pytorch and onnx, group detectors by engine (#1681)
- change: Accept normalized float64 faces in grayscale extraction (#1730)
- change: Clarify installation details for DeepFace
- change: Close owned Neo4j search drivers after pending relationship writes (#1742)
- change: Close owned database clients after building a FAISS index (#1723)
- change: Close streamed image responses on success and failure (#1679)
- change: Configure required ONNX Runtime session options for DirectML (#1720)
- change: Constrain MediaPipe installations to the supported Solutions API (#1757)
- change: Convert BGR detector inputs to RGB before MediaPipe inference (#1709)
- change: Decode embeddings returned by pgvector Python 0.5 (#1752)
- change: Decode the MySQL URI database component exactly once (#1746)
- change: DeepFace Backend Engine Benchmark (#1735)
- change: Generate valid Pinecone names for every supported model configuration (#1708)
- change: Handle FTP gallery endpoints, credentials and failed connections (#1685)
- change: Handle current-directory stream recordings and failed video writers (#1696)
- change: Honor anti-spoofing when face detection is skipped (#1738)
- change: Index gallery filters and MongoDB identity lookups (#1747)
- change: Keep MySQL index chunk replacement atomic with autocommit connections (#1741)
- …and 28 more
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
serengil/deepface was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 16 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 1babd21b4fdcf8b39bc6d557bfb4af98883687c2 — the exact code this score is about.
- Scored under rubric-2026.11.4 — the same rubric and the same method as every other entry in this index.
- Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.83+preprod-a489942cf94b.