Repository Analysis

serengil/deepface

A Lightweight Face Recognition and Facial Attribute Analysis (Age, Gender, Emotion and Race) Library for Python

11.1 Low AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of serengil/deepface, a Python project with 23,105 GitHub stars. SynthScan v2.0 examined 31,950 lines of code across 136 source files, recording 218 pattern matches distributed across 9 syntactic categories. The overall adjusted score of 11.1 places this repository in the Low AI signal band.

The scanner applied 160+ deterministic lexical heuristics, multi-line block detectors, abstract syntax tree depth profilers, and a cross-file Jaccard similarity matrix to construct a statistically normalised synthetic code estimate. All matches are individually weighted by severity coefficient and contextual multiplier before summation, and the resulting headline score is temporally discounted to account for the repository's development history relative to the commercial emergence of large language model coding tooling (November 2022 onward).

11.1
Adjusted Score
11.1
Raw Score
100%
Time Factor
2026-06-29
Last Push
23.1K
Stars
Python
Language
31.9K
Lines of Code
136
Files
218
Pattern Hits
2026-07-14
Scan Date
0.07
HC Hit Rate

What These Metrics Mean

Adjusted Score
Primary synthetic code indicator. Raw score normalised per 1,000 lines of code and multiplied by the temporal discount factor. This is the definitive comparative metric — use it to rank repositories by AI authorship density.
Raw Score
The unmodified sum of all severity-weighted, context-multiplied pattern match scores before temporal discounting. Reflects the absolute signal strength independent of when the repository was last active.
Time Factor
The temporal discount multiplier (0–100%) applied to the raw score. Repositories last updated before ChatGPT's launch (Nov 2022) receive a 5% factor. Full signal is only assigned to repositories active in the post-adoption era (Jan 2024+).
Pattern Hits
Total count of individual pattern matches across all files and categories. A high hit count with a low score may indicate a very large codebase with isolated AI snippets; a low count with a high score indicates dense, concentrated AI signatures.
HC Hit Rate
High+Critical pattern hits per file, averaged across the repository. This orthogonal signal catches repositories where a few files are densely packed with high-severity AI tells — a strong indicator even when the normalised score appears moderate due to codebase size.
Lines of Code / Files
Total lines and files analysed. The scanner examines 94 file extensions. These denominators are used to normalise the score, enabling fair comparison between repositories of vastly different sizes.

Score History

This chart maps the temporal evolution of the adjusted synthetic code score across successive scan runs. An upward trajectory indicates ongoing incorporation of AI-generated code or expanding LLM-assisted scaffolding; a stable or declining trajectory may reflect active human refactoring, code removal, or the adoption of stricter authorship policies. The dashed secondary line (right axis) independently tracks total raw pattern hit count, which can diverge from the normalised score when codebase size changes significantly between scans.

Severity Breakdown

Classifies detected patterns by their diagnostic confidence and structural impact. CRITICAL patterns (coefficient 10) represent definitive synthetic signatures — hallucinated imports, explicit LLM attribution metadata — virtually never produced by human authors. HIGH (5) indicates strong structural tells such as cross-file repetition or cross-linguistic idioms. MEDIUM (2) covers recognisable conversational padding and AI-specific vocabulary. LOW (1) captures subtle indicators like tautological comments and generic boilerplate that require density to carry independent signal.

CRITICAL 0HIGH 10MEDIUM 42LOW 166

Directory Score Breakdown

This horizontal bar chart decomposes the repository's raw synthetic code score by top-level directory, allowing you to pinpoint precisely which modules or components carry the highest AI authorship density. Directories with disproportionately high scores relative to their size warrant targeted manual review: concentrated AI signatures often trace back to mass-generated configuration layers, auto-ported test suites, LLM-scaffolded boilerplate classes, or entire subsystems authored under heavy copilot assistance. Use this view to prioritise your human code-review effort.

Pattern Findings

The scanner identified 218 distinct pattern matches across 9 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a statistically significant AI authorship indicator. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.

Reading the findings table: The Severity column indicates the diagnostic confidence level (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — comment-context matches receive a ×1.5 weight because LLMs systematically over-annotate. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier as dense clusters constitute far stronger evidence of synthetic authorship than isolated hits.

Decorative Section Separators42 hits · 140 pts
SeverityFileLineSnippetContext
MEDIUMdeepface/DeepFace.py37# -----------------------------------COMMENT
MEDIUMdeepface/DeepFace.py48# -----------------------------------COMMENT
MEDIUMdeepface/models/facial_recognition/Facenet.py14# --------------------------------COMMENT
MEDIUMdeepface/models/facial_recognition/Facenet.py56# --------------------------------COMMENT
MEDIUMdeepface/models/facial_recognition/VGGFace.py15# ---------------------------------------COMMENT
MEDIUMdeepface/models/facial_recognition/VGGFace.py39# ---------------------------------------COMMENT
MEDIUMdeepface/models/facial_recognition/DeepID.py88 # ---------------------------------COMMENT
MEDIUMdeepface/models/facial_recognition/FbDeepFace.py8# --------------------------------COMMENT
MEDIUMdeepface/models/facial_recognition/FbDeepFace.py84 # ---------------------------------COMMENT
MEDIUMdeepface/models/facial_recognition/ArcFace.py14# --------------------------------COMMENT
MEDIUMdeepface/models/facial_recognition/ArcFace.py86 # ---------------------------------------COMMENT
MEDIUMdeepface/models/facial_recognition/ArcFace.py92 # ---------------------------------------COMMENT
MEDIUMdeepface/models/facial_recognition/OpenFace.py31# ---------------------------------------COMMENT
MEDIUMdeepface/models/facial_recognition/OpenFace.py387 # -----------------------------------COMMENT
MEDIUMdeepface/models/facial_recognition/OpenFace.py395 # -----------------------------------COMMENT
MEDIUMdeepface/models/demography/Age.py79 # --------------------------COMMENT
MEDIUMdeepface/models/demography/Age.py87 # --------------------------COMMENT
MEDIUMdeepface/models/demography/Age.py91 # --------------------------COMMENT
MEDIUMdeepface/models/demography/Gender.py16# -------------------------------------COMMENT
MEDIUMdeepface/models/demography/Gender.py18# -------------------------------------COMMENT
MEDIUMdeepface/models/demography/Gender.py77 # --------------------------COMMENT
MEDIUMdeepface/models/demography/Gender.py85 # --------------------------COMMENT
MEDIUMdeepface/models/demography/Gender.py89 # --------------------------COMMENT
MEDIUMdeepface/models/demography/Race.py73 # --------------------------COMMENT
MEDIUMdeepface/models/demography/Race.py81 # --------------------------COMMENT
MEDIUMdeepface/models/demography/Race.py85 # --------------------------COMMENT
MEDIUMdeepface/models/demography/Emotion.py121 # ----------------------------COMMENT
MEDIUMdeepface/models/face_detection/OpenCv.py107 # ----------------------------------------------------------------COMMENT
MEDIUMdeepface/models/face_detection/OpenCv.py117 # ----------------------------------------------------------------COMMENT
MEDIUMdeepface/models/face_detection/OpenCv.py131 # -----------------------COMMENT
MEDIUMdeepface/modules/recognition.py283 # ----------------------------COMMENT
MEDIUMdeepface/modules/recognition.py387 # ---------------------------COMMENT
MEDIUMdeepface/modules/recognition.py405 # -----------------------------------COMMENT
MEDIUMdeepface/modules/representation.py154 # ---------------------------------COMMENT
MEDIUMdeepface/modules/demography.py148 # ---------------------------------COMMENT
MEDIUMdeepface/modules/demography.py235 # -----------------------------COMMENT
MEDIUMtests/unit/face-recognition-how.py14# ----------------------------------------------COMMENT
MEDIUMtests/unit/face-recognition-how.py25# ----------------------------------------------COMMENT
MEDIUMtests/unit/face-recognition-how.py41# ----------------------------------------------COMMENT
MEDIUMtests/unit/face-recognition-how.py60# ----------------------------------------------COMMENT
MEDIUMtests/unit/face-recognition-how.py76# ----------------------------------------------COMMENT
MEDIUMtests/unit/face-recognition-how.py107# ----------------------------------------------COMMENT
Hyper-Verbose Identifiers92 hits · 92 pts
SeverityFileLineSnippetContext
LOWdeepface/commons/image_utils.py135def load_image_from_io_object(obj: IO[bytes]) -> NDArray[Any]:CODE
LOWdeepface/commons/image_utils.py191def load_image_from_file_storage(file: FileStorage) -> NDArray[Any]:CODE
LOWdeepface/commons/weight_utils.py29def download_weights_if_necessary(CODE
LOWdeepface/commons/weight_utils.py104def download_all_models_in_one_shot() -> None:CODE
LOWdeepface/models/Demography.py58 def _preprocess_batch_or_single_input(CODE
LOWdeepface/api/src/modules/core/routes.py29def extract_image_from_request(img_key: str) -> Union[str, NDArray[Any]]:CODE
LOWdeepface/modules/verification.py133 def extract_embeddings_and_facial_areas(CODE
LOWdeepface/modules/verification.py243def __extract_faces_and_embeddings(CODE
LOWdeepface/modules/streaming.py226def build_facial_recognition_model(model_name: str) -> None:CODE
LOWdeepface/modules/streaming.py504def perform_facial_recognition(CODE
LOWdeepface/modules/streaming.py561def perform_demography_analysis(CODE
LOWdeepface/modules/normalization.py12def normalize_embedding_minmax(CODE
LOWdeepface/modules/database/milvus.py226 def __generate_collection_name(CODE
LOWtests/unit/test_find_batched.py18def test_find_with_exact_path():CODE
LOWtests/unit/test_find_batched.py57def test_batched_find_with_similarity_search():CODE
LOWtests/unit/test_find_batched.py103def test_find_with_array_input():CODE
LOWtests/unit/test_find_batched.py126def test_find_with_extracted_faces():CODE
LOWtests/unit/test_singleton.py6def test_singleton_same_object():CODE
LOWtests/unit/test_encrypt.py76def test_encrypt_single_skip_case():CODE
LOWtests/unit/test_encrypt.py121def test_encrypt_batch_skip_case():CODE
LOWtests/unit/test_encrypt.py176def test_homomorphic_encryption():CODE
LOWtests/unit/test_verify.py17def test_different_facial_recognition_models():CODE
LOWtests/unit/test_verify.py76def test_different_face_detectors():CODE
LOWtests/unit/test_verify.py112def test_verify_for_preloaded_image():CODE
LOWtests/unit/test_verify.py120def test_verify_for_precalculated_embeddings():CODE
LOWtests/unit/test_verify.py159def test_verify_with_precalculated_embeddings_for_incorrect_model():CODE
LOWtests/unit/test_verify.py177def test_verify_for_broken_embeddings():CODE
LOWtests/unit/test_verify.py189def test_verify_for_nested_embeddings():CODE
LOWtests/unit/test_verify.py205def test_compability_of_verify_and_represent():CODE
LOWtests/unit/test_output_normalization.py10def test_minmax_normalization():CODE
LOWtests/unit/test_output_normalization.py33def test_minmax_normalization_batch():CODE
LOWtests/unit/test_output_normalization.py50def test_minmax_normalization_edge_values():CODE
LOWtests/unit/test_enforce_detection.py12def test_enabled_enforce_detection_for_non_facial_input():CODE
LOWtests/unit/test_enforce_detection.py24def test_disabled_enforce_detection_for_non_facial_input_on_represent():CODE
LOWtests/unit/test_enforce_detection.py44def test_disabled_enforce_detection_for_non_facial_input_on_verify():CODE
LOWtests/unit/test_signature.py42 def test_sign_and_verify_happy_path_with_obj(self):CODE
LOWtests/unit/test_signature.py66 def test_sign_and_verify_happy_path_with_dict(self):CODE
LOWtests/unit/test_signature.py83 def test_missing_algorithm_in_dict(self):CODE
LOWtests/unit/test_signature.py99 def test_tampered_datastore_detection_with_type_error(self):CODE
LOWtests/unit/test_signature.py121 def test_tampered_datastore_detection_with_content(self):CODE
LOWtests/unit/test_signature.py166 def test_unsigned_datastore_detected(self):CODE
LOWtests/unit/test_signature.py184 def test_signed_datastore_with_no_credentials(self):CODE
LOWtests/unit/test_signature.py241 def __flush_datastore_and_signature(self):CODE
LOWtests/unit/test_find.py20def test_find_with_exact_path():CODE
LOWtests/unit/test_find.py49def test_find_with_array_input():CODE
LOWtests/unit/test_find.py71def test_find_with_extracted_faces():CODE
LOWtests/unit/test_find.py106def test_filetype_for_find_bulk_embeddings():CODE
LOWtests/unit/test_find.py126def test_find_without_refresh_database():CODE
LOWtests/unit/test_find.py176def test_find_for_similarity_search():CODE
LOWtests/unit/test_landmark_sanitization.py42def test_extract_faces_sanitizes_landmarks(monkeypatch):CODE
LOWtests/unit/test_commons.py32def test_loading_broken_weights():CODE
LOWtests/unit/test_commons.py64 def test_download_weights_for_available_file(CODE
LOWtests/unit/test_commons.py91 def test_download_weights_if_necessary_gdown_failure(CODE
LOWtests/unit/test_commons.py120 def test_download_weights_if_necessary_no_compression(CODE
LOWtests/unit/test_commons.py155 def test_download_weights_if_necessary_zip(CODE
LOWtests/unit/test_commons.py245 def test_download_weights_for_non_supported_compress_type(CODE
LOWtests/unit/test_extract_faces.py102def test_backends_for_enforced_detection_with_non_facial_inputs():CODE
LOWtests/unit/test_extract_faces.py110def test_backends_for_not_enforced_detection_with_non_facial_inputs():CODE
LOWtests/unit/test_extract_faces.py141def test_facial_coordinates_are_in_borders():CODE
LOWtests/unit/test_extract_faces.py191def test_batch_ndarray_inputs():CODE
32 more matches not shown…
Cross-File Repetition10 hits · 50 pts
SeverityFileLineSnippetContext
HIGHdeepface/models/face_detection/RetinaFace.py0detect and align face with dlib args: img (np.ndarray): pre-loaded image as numpy array returns: results (list[facialareSTRING
HIGHdeepface/models/face_detection/FastMtCnn.py0detect and align face with dlib args: img (np.ndarray): pre-loaded image as numpy array returns: results (list[facialareSTRING
HIGHdeepface/models/face_detection/MtCnn.py0detect and align face with dlib args: img (np.ndarray): pre-loaded image as numpy array returns: results (list[facialareSTRING
HIGHdeepface/models/face_detection/MediaPipe.py0detect and align face with dlib args: img (np.ndarray): pre-loaded image as numpy array returns: results (list[facialareSTRING
HIGHdeepface/models/face_detection/Ssd.py0detect and align face with dlib args: img (np.ndarray): pre-loaded image as numpy array returns: results (list[facialareSTRING
HIGHdeepface/models/face_detection/CenterFace.py0detect and align face with dlib args: img (np.ndarray): pre-loaded image as numpy array returns: results (list[facialareSTRING
HIGHdeepface/models/face_detection/OpenCv.py0detect and align face with dlib args: img (np.ndarray): pre-loaded image as numpy array returns: results (list[facialareSTRING
HIGHdeepface/models/face_detection/YuNet.py0detect and align face with dlib args: img (np.ndarray): pre-loaded image as numpy array returns: results (list[facialareSTRING
HIGHdeepface/models/face_detection/Yolo.py0detect and align face with dlib args: img (np.ndarray): pre-loaded image as numpy array returns: results (list[facialareSTRING
HIGHdeepface/models/face_detection/Dlib.py0detect and align face with dlib args: img (np.ndarray): pre-loaded image as numpy array returns: results (list[facialareSTRING
Excessive Try-Catch Wrapping26 hits · 24 pts
SeverityFileLineSnippetContext
LOWdeepface/commons/weight_utils.py60 except Exception as err:CODE
LOWdeepface/commons/weight_utils.py93 except Exception as err:CODE
LOWdeepface/commons/logger.py30 except Exception as err:CODE
LOWdeepface/models/facial_recognition/SFace.py79 except Exception as err:CODE
LOWdeepface/models/facial_recognition/Buffalo_L.py29 except Exception as err:CODE
LOWdeepface/models/face_detection/Ssd.py48 except Exception as err:CODE
LOWdeepface/models/face_detection/YuNet.py52 except Exception as err:CODE
LOWdeepface/models/spoofing/FasNet.py32 except Exception as err:CODE
LOWdeepface/api/src/modules/core/service.py40 except Exception as err:CODE
LOWdeepface/api/src/modules/core/service.py69 except Exception as err:CODE
LOWdeepface/api/src/modules/core/service.py97 except Exception as err:CODE
LOWdeepface/api/src/modules/core/service.py136 except Exception as err:CODE
LOWdeepface/api/src/modules/core/service.py183 except Exception as err:CODE
LOWdeepface/api/src/modules/core/service.py208 except Exception as err:CODE
LOWdeepface/api/src/modules/core/routes.py89 except Exception as err:CODE
LOWdeepface/api/src/modules/core/routes.py122 except Exception as err:CODE
LOWdeepface/api/src/modules/core/routes.py127 except Exception as err:CODE
LOWdeepface/api/src/modules/core/routes.py159 except Exception as err:CODE
LOWdeepface/api/src/modules/core/routes.py211 except Exception as err:CODE
LOWdeepface/api/src/modules/core/routes.py257 except Exception as err:CODE
LOWdeepface/modules/streaming.py863 except Exception as err: # pylint: disable=broad-exceptCODE
LOWdeepface/modules/database/neo4j.py327 except Exception as e: # pylint: disable=broad-exceptSTRING
LOWdeepface/modules/database/pgvector.py77 except Exception as e:CODE
LOWdeepface/modules/database/pgvector.py148 except Exception as e: # pylint: disable=broad-exceptSTRING
LOWdeepface/modules/database/pgvector.py156 except Exception as e:STRING
LOWdeepface/modules/database/postgres.py113 except Exception as e:STRING
AI Structural Patterns19 hits · 19 pts
SeverityFileLineSnippetContext
LOWdeepface/DeepFace.py75CODE
LOWdeepface/DeepFace.py281CODE
LOWdeepface/DeepFace.py420CODE
LOWdeepface/DeepFace.py523CODE
LOWdeepface/DeepFace.py591CODE
LOWdeepface/DeepFace.py724CODE
LOWdeepface/DeepFace.py798CODE
LOWdeepface/DeepFace.py907CODE
LOWdeepface/models/spoofing/FasNetBackbone.py519CODE
LOWdeepface/modules/recognition.py31CODE
LOWdeepface/modules/recognition.py518CODE
LOWdeepface/modules/detection.py47CODE
LOWdeepface/modules/verification.py27CODE
LOWdeepface/modules/streaming.py28CODE
LOWdeepface/modules/representation.py23CODE
LOWdeepface/modules/datastore.py34CODE
LOWdeepface/modules/datastore.py140CODE
LOWdeepface/modules/datastore.py480CODE
LOWdeepface/modules/datastore.py631CODE
Deep Nesting16 hits · 16 pts
SeverityFileLineSnippetContext
LOWdeepface/commons/image_utils.py25CODE
LOWdeepface/commons/image_utils.py44CODE
LOWdeepface/commons/weight_utils.py104CODE
LOWdeepface/modules/recognition.py796CODE
LOWdeepface/modules/detection.py47CODE
LOWdeepface/modules/verification.py433CODE
LOWdeepface/modules/preprocessing.py20CODE
LOWdeepface/modules/streaming.py28CODE
LOWdeepface/modules/streaming.py612CODE
LOWdeepface/modules/streaming.py868CODE
LOWdeepface/modules/datastore.py140CODE
LOWdeepface/modules/demography.py16CODE
LOWdeepface/modules/database/pgvector.py89CODE
LOWtests/unit/test_verify.py17CODE
LOWtests/unit/test_signature.py121CODE
LOWtests/unit/test_analyze.py119CODE
Redundant / Tautological Comments4 hits · 6 pts
SeverityFileLineSnippetContext
LOWdeepface/models/Demography.py46 if not self.model_name: # Check if called from derived classCODE
LOWdeepface/api/src/modules/core/routes.py42 # Check if the request is multipart/form-data (file input)COMMENT
LOWdeepface/api/src/modules/core/routes.py57 # Check if the request is coming as base64, file path or url from json or form dataCOMMENT
LOWdeepface/modules/database/weaviate.py150 # Check if embedding already existsCOMMENT
Unused Imports5 hits · 5 pts
SeverityFileLineSnippetContext
LOWdeepface/DeepFace.py33CODE
LOWdeepface/modules/modeling.py1CODE
LOWdeepface/modules/database/inventory.py5CODE
LOWtests/unit/test_landmark_sanitization.py2CODE
LOWtests/integration/test_postgres_search.py3CODE
Over-Commented Block4 hits · 4 pts
SeverityFileLineSnippetContext
LOWtests/unit/stream.py1from deepface import DeepFaceCOMMENT
LOWscripts/dockerize.sh1# Dockerfile is in the rootCOMMENT
LOWscripts/dockerize.sh41# to access the inside of docker image when it is in running statusCOMMENT
LOW.github/workflows/tests.yml1name: TestsCOMMENT