A Lightweight Face Recognition and Facial Attribute Analysis (Age, Gender, Emotion and Race) Library for Python
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).
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.
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.
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.
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.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | deepface/DeepFace.py | 37 | # ----------------------------------- | COMMENT |
| MEDIUM | deepface/DeepFace.py | 48 | # ----------------------------------- | COMMENT |
| MEDIUM | deepface/models/facial_recognition/Facenet.py | 14 | # -------------------------------- | COMMENT |
| MEDIUM | deepface/models/facial_recognition/Facenet.py | 56 | # -------------------------------- | COMMENT |
| MEDIUM | deepface/models/facial_recognition/VGGFace.py | 15 | # --------------------------------------- | COMMENT |
| MEDIUM | deepface/models/facial_recognition/VGGFace.py | 39 | # --------------------------------------- | COMMENT |
| MEDIUM | deepface/models/facial_recognition/DeepID.py | 88 | # --------------------------------- | COMMENT |
| MEDIUM | deepface/models/facial_recognition/FbDeepFace.py | 8 | # -------------------------------- | COMMENT |
| MEDIUM | deepface/models/facial_recognition/FbDeepFace.py | 84 | # --------------------------------- | COMMENT |
| MEDIUM | deepface/models/facial_recognition/ArcFace.py | 14 | # -------------------------------- | COMMENT |
| MEDIUM | deepface/models/facial_recognition/ArcFace.py | 86 | # --------------------------------------- | COMMENT |
| MEDIUM | deepface/models/facial_recognition/ArcFace.py | 92 | # --------------------------------------- | COMMENT |
| MEDIUM | deepface/models/facial_recognition/OpenFace.py | 31 | # --------------------------------------- | COMMENT |
| MEDIUM | deepface/models/facial_recognition/OpenFace.py | 387 | # ----------------------------------- | COMMENT |
| MEDIUM | deepface/models/facial_recognition/OpenFace.py | 395 | # ----------------------------------- | COMMENT |
| MEDIUM⚡ | deepface/models/demography/Age.py | 79 | # -------------------------- | COMMENT |
| MEDIUM⚡ | deepface/models/demography/Age.py | 87 | # -------------------------- | COMMENT |
| MEDIUM⚡ | deepface/models/demography/Age.py | 91 | # -------------------------- | COMMENT |
| MEDIUM | deepface/models/demography/Gender.py | 16 | # ------------------------------------- | COMMENT |
| MEDIUM | deepface/models/demography/Gender.py | 18 | # ------------------------------------- | COMMENT |
| MEDIUM⚡ | deepface/models/demography/Gender.py | 77 | # -------------------------- | COMMENT |
| MEDIUM⚡ | deepface/models/demography/Gender.py | 85 | # -------------------------- | COMMENT |
| MEDIUM⚡ | deepface/models/demography/Gender.py | 89 | # -------------------------- | COMMENT |
| MEDIUM⚡ | deepface/models/demography/Race.py | 73 | # -------------------------- | COMMENT |
| MEDIUM⚡ | deepface/models/demography/Race.py | 81 | # -------------------------- | COMMENT |
| MEDIUM⚡ | deepface/models/demography/Race.py | 85 | # -------------------------- | COMMENT |
| MEDIUM | deepface/models/demography/Emotion.py | 121 | # ---------------------------- | COMMENT |
| MEDIUM | deepface/models/face_detection/OpenCv.py | 107 | # ---------------------------------------------------------------- | COMMENT |
| MEDIUM | deepface/models/face_detection/OpenCv.py | 117 | # ---------------------------------------------------------------- | COMMENT |
| MEDIUM | deepface/models/face_detection/OpenCv.py | 131 | # ----------------------- | COMMENT |
| MEDIUM | deepface/modules/recognition.py | 283 | # ---------------------------- | COMMENT |
| MEDIUM | deepface/modules/recognition.py | 387 | # --------------------------- | COMMENT |
| MEDIUM | deepface/modules/recognition.py | 405 | # ----------------------------------- | COMMENT |
| MEDIUM | deepface/modules/representation.py | 154 | # --------------------------------- | COMMENT |
| MEDIUM | deepface/modules/demography.py | 148 | # --------------------------------- | COMMENT |
| MEDIUM | deepface/modules/demography.py | 235 | # ----------------------------- | COMMENT |
| MEDIUM | tests/unit/face-recognition-how.py | 14 | # ---------------------------------------------- | COMMENT |
| MEDIUM | tests/unit/face-recognition-how.py | 25 | # ---------------------------------------------- | COMMENT |
| MEDIUM | tests/unit/face-recognition-how.py | 41 | # ---------------------------------------------- | COMMENT |
| MEDIUM | tests/unit/face-recognition-how.py | 60 | # ---------------------------------------------- | COMMENT |
| MEDIUM | tests/unit/face-recognition-how.py | 76 | # ---------------------------------------------- | COMMENT |
| MEDIUM | tests/unit/face-recognition-how.py | 107 | # ---------------------------------------------- | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | deepface/commons/image_utils.py | 135 | def load_image_from_io_object(obj: IO[bytes]) -> NDArray[Any]: | CODE |
| LOW | deepface/commons/image_utils.py | 191 | def load_image_from_file_storage(file: FileStorage) -> NDArray[Any]: | CODE |
| LOW | deepface/commons/weight_utils.py | 29 | def download_weights_if_necessary( | CODE |
| LOW | deepface/commons/weight_utils.py | 104 | def download_all_models_in_one_shot() -> None: | CODE |
| LOW | deepface/models/Demography.py | 58 | def _preprocess_batch_or_single_input( | CODE |
| LOW | deepface/api/src/modules/core/routes.py | 29 | def extract_image_from_request(img_key: str) -> Union[str, NDArray[Any]]: | CODE |
| LOW | deepface/modules/verification.py | 133 | def extract_embeddings_and_facial_areas( | CODE |
| LOW | deepface/modules/verification.py | 243 | def __extract_faces_and_embeddings( | CODE |
| LOW | deepface/modules/streaming.py | 226 | def build_facial_recognition_model(model_name: str) -> None: | CODE |
| LOW | deepface/modules/streaming.py | 504 | def perform_facial_recognition( | CODE |
| LOW | deepface/modules/streaming.py | 561 | def perform_demography_analysis( | CODE |
| LOW | deepface/modules/normalization.py | 12 | def normalize_embedding_minmax( | CODE |
| LOW | deepface/modules/database/milvus.py | 226 | def __generate_collection_name( | CODE |
| LOW | tests/unit/test_find_batched.py | 18 | def test_find_with_exact_path(): | CODE |
| LOW | tests/unit/test_find_batched.py | 57 | def test_batched_find_with_similarity_search(): | CODE |
| LOW | tests/unit/test_find_batched.py | 103 | def test_find_with_array_input(): | CODE |
| LOW | tests/unit/test_find_batched.py | 126 | def test_find_with_extracted_faces(): | CODE |
| LOW | tests/unit/test_singleton.py | 6 | def test_singleton_same_object(): | CODE |
| LOW | tests/unit/test_encrypt.py | 76 | def test_encrypt_single_skip_case(): | CODE |
| LOW | tests/unit/test_encrypt.py | 121 | def test_encrypt_batch_skip_case(): | CODE |
| LOW | tests/unit/test_encrypt.py | 176 | def test_homomorphic_encryption(): | CODE |
| LOW | tests/unit/test_verify.py | 17 | def test_different_facial_recognition_models(): | CODE |
| LOW | tests/unit/test_verify.py | 76 | def test_different_face_detectors(): | CODE |
| LOW | tests/unit/test_verify.py | 112 | def test_verify_for_preloaded_image(): | CODE |
| LOW | tests/unit/test_verify.py | 120 | def test_verify_for_precalculated_embeddings(): | CODE |
| LOW | tests/unit/test_verify.py | 159 | def test_verify_with_precalculated_embeddings_for_incorrect_model(): | CODE |
| LOW | tests/unit/test_verify.py | 177 | def test_verify_for_broken_embeddings(): | CODE |
| LOW | tests/unit/test_verify.py | 189 | def test_verify_for_nested_embeddings(): | CODE |
| LOW | tests/unit/test_verify.py | 205 | def test_compability_of_verify_and_represent(): | CODE |
| LOW | tests/unit/test_output_normalization.py | 10 | def test_minmax_normalization(): | CODE |
| LOW | tests/unit/test_output_normalization.py | 33 | def test_minmax_normalization_batch(): | CODE |
| LOW | tests/unit/test_output_normalization.py | 50 | def test_minmax_normalization_edge_values(): | CODE |
| LOW | tests/unit/test_enforce_detection.py | 12 | def test_enabled_enforce_detection_for_non_facial_input(): | CODE |
| LOW | tests/unit/test_enforce_detection.py | 24 | def test_disabled_enforce_detection_for_non_facial_input_on_represent(): | CODE |
| LOW | tests/unit/test_enforce_detection.py | 44 | def test_disabled_enforce_detection_for_non_facial_input_on_verify(): | CODE |
| LOW | tests/unit/test_signature.py | 42 | def test_sign_and_verify_happy_path_with_obj(self): | CODE |
| LOW | tests/unit/test_signature.py | 66 | def test_sign_and_verify_happy_path_with_dict(self): | CODE |
| LOW | tests/unit/test_signature.py | 83 | def test_missing_algorithm_in_dict(self): | CODE |
| LOW | tests/unit/test_signature.py | 99 | def test_tampered_datastore_detection_with_type_error(self): | CODE |
| LOW | tests/unit/test_signature.py | 121 | def test_tampered_datastore_detection_with_content(self): | CODE |
| LOW | tests/unit/test_signature.py | 166 | def test_unsigned_datastore_detected(self): | CODE |
| LOW | tests/unit/test_signature.py | 184 | def test_signed_datastore_with_no_credentials(self): | CODE |
| LOW | tests/unit/test_signature.py | 241 | def __flush_datastore_and_signature(self): | CODE |
| LOW | tests/unit/test_find.py | 20 | def test_find_with_exact_path(): | CODE |
| LOW | tests/unit/test_find.py | 49 | def test_find_with_array_input(): | CODE |
| LOW | tests/unit/test_find.py | 71 | def test_find_with_extracted_faces(): | CODE |
| LOW | tests/unit/test_find.py | 106 | def test_filetype_for_find_bulk_embeddings(): | CODE |
| LOW | tests/unit/test_find.py | 126 | def test_find_without_refresh_database(): | CODE |
| LOW | tests/unit/test_find.py | 176 | def test_find_for_similarity_search(): | CODE |
| LOW | tests/unit/test_landmark_sanitization.py | 42 | def test_extract_faces_sanitizes_landmarks(monkeypatch): | CODE |
| LOW | tests/unit/test_commons.py | 32 | def test_loading_broken_weights(): | CODE |
| LOW | tests/unit/test_commons.py | 64 | def test_download_weights_for_available_file( | CODE |
| LOW | tests/unit/test_commons.py | 91 | def test_download_weights_if_necessary_gdown_failure( | CODE |
| LOW | tests/unit/test_commons.py | 120 | def test_download_weights_if_necessary_no_compression( | CODE |
| LOW | tests/unit/test_commons.py | 155 | def test_download_weights_if_necessary_zip( | CODE |
| LOW | tests/unit/test_commons.py | 245 | def test_download_weights_for_non_supported_compress_type( | CODE |
| LOW | tests/unit/test_extract_faces.py | 102 | def test_backends_for_enforced_detection_with_non_facial_inputs(): | CODE |
| LOW | tests/unit/test_extract_faces.py | 110 | def test_backends_for_not_enforced_detection_with_non_facial_inputs(): | CODE |
| LOW | tests/unit/test_extract_faces.py | 141 | def test_facial_coordinates_are_in_borders(): | CODE |
| LOW | tests/unit/test_extract_faces.py | 191 | def test_batch_ndarray_inputs(): | CODE |
| 32 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | deepface/models/face_detection/RetinaFace.py | 0 | detect and align face with dlib args: img (np.ndarray): pre-loaded image as numpy array returns: results (list[facialare | STRING |
| HIGH | deepface/models/face_detection/FastMtCnn.py | 0 | detect and align face with dlib args: img (np.ndarray): pre-loaded image as numpy array returns: results (list[facialare | STRING |
| HIGH | deepface/models/face_detection/MtCnn.py | 0 | detect and align face with dlib args: img (np.ndarray): pre-loaded image as numpy array returns: results (list[facialare | STRING |
| HIGH | deepface/models/face_detection/MediaPipe.py | 0 | detect and align face with dlib args: img (np.ndarray): pre-loaded image as numpy array returns: results (list[facialare | STRING |
| HIGH | deepface/models/face_detection/Ssd.py | 0 | detect and align face with dlib args: img (np.ndarray): pre-loaded image as numpy array returns: results (list[facialare | STRING |
| HIGH | deepface/models/face_detection/CenterFace.py | 0 | detect and align face with dlib args: img (np.ndarray): pre-loaded image as numpy array returns: results (list[facialare | STRING |
| HIGH | deepface/models/face_detection/OpenCv.py | 0 | detect and align face with dlib args: img (np.ndarray): pre-loaded image as numpy array returns: results (list[facialare | STRING |
| HIGH | deepface/models/face_detection/YuNet.py | 0 | detect and align face with dlib args: img (np.ndarray): pre-loaded image as numpy array returns: results (list[facialare | STRING |
| HIGH | deepface/models/face_detection/Yolo.py | 0 | detect and align face with dlib args: img (np.ndarray): pre-loaded image as numpy array returns: results (list[facialare | STRING |
| HIGH | deepface/models/face_detection/Dlib.py | 0 | detect and align face with dlib args: img (np.ndarray): pre-loaded image as numpy array returns: results (list[facialare | STRING |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | deepface/commons/weight_utils.py | 60 | except Exception as err: | CODE |
| LOW | deepface/commons/weight_utils.py | 93 | except Exception as err: | CODE |
| LOW | deepface/commons/logger.py | 30 | except Exception as err: | CODE |
| LOW | deepface/models/facial_recognition/SFace.py | 79 | except Exception as err: | CODE |
| LOW | deepface/models/facial_recognition/Buffalo_L.py | 29 | except Exception as err: | CODE |
| LOW | deepface/models/face_detection/Ssd.py | 48 | except Exception as err: | CODE |
| LOW | deepface/models/face_detection/YuNet.py | 52 | except Exception as err: | CODE |
| LOW | deepface/models/spoofing/FasNet.py | 32 | except Exception as err: | CODE |
| LOW | deepface/api/src/modules/core/service.py | 40 | except Exception as err: | CODE |
| LOW | deepface/api/src/modules/core/service.py | 69 | except Exception as err: | CODE |
| LOW | deepface/api/src/modules/core/service.py | 97 | except Exception as err: | CODE |
| LOW | deepface/api/src/modules/core/service.py | 136 | except Exception as err: | CODE |
| LOW | deepface/api/src/modules/core/service.py | 183 | except Exception as err: | CODE |
| LOW | deepface/api/src/modules/core/service.py | 208 | except Exception as err: | CODE |
| LOW | deepface/api/src/modules/core/routes.py | 89 | except Exception as err: | CODE |
| LOW | deepface/api/src/modules/core/routes.py | 122 | except Exception as err: | CODE |
| LOW | deepface/api/src/modules/core/routes.py | 127 | except Exception as err: | CODE |
| LOW | deepface/api/src/modules/core/routes.py | 159 | except Exception as err: | CODE |
| LOW | deepface/api/src/modules/core/routes.py | 211 | except Exception as err: | CODE |
| LOW | deepface/api/src/modules/core/routes.py | 257 | except Exception as err: | CODE |
| LOW | deepface/modules/streaming.py | 863 | except Exception as err: # pylint: disable=broad-except | CODE |
| LOW | deepface/modules/database/neo4j.py | 327 | except Exception as e: # pylint: disable=broad-except | STRING |
| LOW | deepface/modules/database/pgvector.py | 77 | except Exception as e: | CODE |
| LOW | deepface/modules/database/pgvector.py | 148 | except Exception as e: # pylint: disable=broad-except | STRING |
| LOW | deepface/modules/database/pgvector.py | 156 | except Exception as e: | STRING |
| LOW | deepface/modules/database/postgres.py | 113 | except Exception as e: | STRING |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | deepface/DeepFace.py | 75 | CODE | |
| LOW | deepface/DeepFace.py | 281 | CODE | |
| LOW | deepface/DeepFace.py | 420 | CODE | |
| LOW | deepface/DeepFace.py | 523 | CODE | |
| LOW | deepface/DeepFace.py | 591 | CODE | |
| LOW | deepface/DeepFace.py | 724 | CODE | |
| LOW | deepface/DeepFace.py | 798 | CODE | |
| LOW | deepface/DeepFace.py | 907 | CODE | |
| LOW | deepface/models/spoofing/FasNetBackbone.py | 519 | CODE | |
| LOW | deepface/modules/recognition.py | 31 | CODE | |
| LOW | deepface/modules/recognition.py | 518 | CODE | |
| LOW | deepface/modules/detection.py | 47 | CODE | |
| LOW | deepface/modules/verification.py | 27 | CODE | |
| LOW | deepface/modules/streaming.py | 28 | CODE | |
| LOW | deepface/modules/representation.py | 23 | CODE | |
| LOW | deepface/modules/datastore.py | 34 | CODE | |
| LOW | deepface/modules/datastore.py | 140 | CODE | |
| LOW | deepface/modules/datastore.py | 480 | CODE | |
| LOW | deepface/modules/datastore.py | 631 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | deepface/commons/image_utils.py | 25 | CODE | |
| LOW | deepface/commons/image_utils.py | 44 | CODE | |
| LOW | deepface/commons/weight_utils.py | 104 | CODE | |
| LOW | deepface/modules/recognition.py | 796 | CODE | |
| LOW | deepface/modules/detection.py | 47 | CODE | |
| LOW | deepface/modules/verification.py | 433 | CODE | |
| LOW | deepface/modules/preprocessing.py | 20 | CODE | |
| LOW | deepface/modules/streaming.py | 28 | CODE | |
| LOW | deepface/modules/streaming.py | 612 | CODE | |
| LOW | deepface/modules/streaming.py | 868 | CODE | |
| LOW | deepface/modules/datastore.py | 140 | CODE | |
| LOW | deepface/modules/demography.py | 16 | CODE | |
| LOW | deepface/modules/database/pgvector.py | 89 | CODE | |
| LOW | tests/unit/test_verify.py | 17 | CODE | |
| LOW | tests/unit/test_signature.py | 121 | CODE | |
| LOW | tests/unit/test_analyze.py | 119 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | deepface/models/Demography.py | 46 | if not self.model_name: # Check if called from derived class | CODE |
| LOW | deepface/api/src/modules/core/routes.py | 42 | # Check if the request is multipart/form-data (file input) | COMMENT |
| LOW | deepface/api/src/modules/core/routes.py | 57 | # Check if the request is coming as base64, file path or url from json or form data | COMMENT |
| LOW | deepface/modules/database/weaviate.py | 150 | # Check if embedding already exists | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | deepface/DeepFace.py | 33 | CODE | |
| LOW | deepface/modules/modeling.py | 1 | CODE | |
| LOW | deepface/modules/database/inventory.py | 5 | CODE | |
| LOW | tests/unit/test_landmark_sanitization.py | 2 | CODE | |
| LOW | tests/integration/test_postgres_search.py | 3 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/unit/stream.py | 1 | from deepface import DeepFace | COMMENT |
| LOW | scripts/dockerize.sh | 1 | # Dockerfile is in the root | COMMENT |
| LOW | scripts/dockerize.sh | 41 | # to access the inside of docker image when it is in running status | COMMENT |
| LOW | .github/workflows/tests.yml | 1 | name: Tests | COMMENT |