The world's simplest facial recognition api for Python and the command line
This report presents the forensic synthetic code analysis of ageitgey/face_recognition, a Python project with 56,578 GitHub stars. SynthScan v2.0 examined 4,699 lines of code across 44 source files, recording 78 pattern matches distributed across 9 syntactic categories. The overall adjusted score of 23.3 places this repository in the Moderate 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 78 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 | docs/conf.py | 7 | # This file is execfile()d with the current directory set to its | COMMENT |
| MEDIUM | examples/facerec_from_webcam_faster.py | 35 | # Initialize some variables | COMMENT |
| MEDIUM | examples/blur_faces_on_webcam.py | 13 | # Initialize some variables | COMMENT |
| MEDIUM | examples/identify_and_draw_boxes_on_faces.py | 36 | # Create a Pillow ImageDraw Draw instance to draw with | COMMENT |
| MEDIUM | examples/facerec_from_webcam_multiprocessing.py | 143 | # Create a thread to capture frames (if uses subprocess, it will crash on Mac) | COMMENT |
| MEDIUM | examples/facerec_from_video_file.py | 14 | # Create an output movie file (make sure resolution/frame rate matches input video!) | COMMENT |
| MEDIUM | examples/facerec_from_video_file.py | 30 | # Initialize some variables | COMMENT |
| MEDIUM | examples/find_faces_in_picture.py | 8 | # This method is fairly accurate, but not as accurate as the CNN model and not GPU accelerated. | COMMENT |
| MEDIUM | examples/facerec_on_raspberry_pi.py | 25 | # Initialize some variables | COMMENT |
| MEDIUM | examples/find_faces_in_picture_cnn.py | 8 | # This method is more accurate than the default HOG model, but it's slower | COMMENT |
| MEDIUM | examples/find_facial_features_in_picture.py | 12 | # Create a PIL imagedraw object so we can draw on the picture | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | face_recognition/api.py | 124 | def _raw_face_locations_batched(images, number_of_times_to_upsample=1, batch_size=128): | CODE |
| LOW | face_recognition/api.py | 146 | def convert_cnn_detections_to_css(detections): | CODE |
| LOW | face_recognition/face_detection_cli.py | 29 | def process_images_in_process_pool(images_to_check, number_of_cpus, model, upsample): | CODE |
| LOW | face_recognition/face_recognition_cli.py | 71 | def process_images_in_process_pool(images_to_check, known_names, known_face_encodings, number_of_cpus, tolerance, show_d | CODE |
| LOW | tests/test_face_recognition.py | 40 | def test_cnn_raw_face_locations(self): | CODE |
| LOW | tests/test_face_recognition.py | 81 | def test_partial_face_locations(self): | CODE |
| LOW | tests/test_face_recognition.py | 94 | def test_raw_face_locations_batched(self): | CODE |
| LOW | tests/test_face_recognition.py | 104 | def test_batched_face_locations(self): | CODE |
| LOW | tests/test_face_recognition.py | 139 | def test_face_landmarks_small_model(self): | CODE |
| LOW | tests/test_face_recognition.py | 155 | def test_face_encodings_large_model(self): | CODE |
| LOW | tests/test_face_recognition.py | 188 | def test_face_distance_empty_lists(self): | CODE |
| LOW | tests/test_face_recognition.py | 230 | def test_compare_faces_empty_lists(self): | CODE |
| LOW | tests/test_face_recognition.py | 248 | def test_command_line_interface_options(self): | CODE |
| LOW | tests/test_face_recognition.py | 255 | def test_command_line_interface(self): | CODE |
| LOW | tests/test_face_recognition.py | 266 | def test_command_line_interface_big_image(self): | CODE |
| LOW | tests/test_face_recognition.py | 277 | def test_command_line_interface_tolerance(self): | CODE |
| LOW | tests/test_face_recognition.py | 288 | def test_command_line_interface_show_distance(self): | CODE |
| LOW⚡ | tests/test_face_recognition.py | 299 | def test_fd_command_line_interface_options(self): | CODE |
| LOW⚡ | tests/test_face_recognition.py | 306 | def test_fd_command_line_interface(self): | CODE |
| LOW⚡ | tests/test_face_recognition.py | 316 | def test_fd_command_line_interface_folder(self): | CODE |
| LOW | tests/test_face_recognition.py | 328 | def test_fd_command_line_interface_hog_model(self): | CODE |
| LOW | tests/test_face_recognition.py | 337 | def test_fd_command_line_interface_cnn_model(self): | CODE |
| LOW | examples/face_recognition_knn.py | 153 | def show_prediction_labels_on_image(img_path, predictions): | CODE |
| LOW | examples/facerec_ipcamera_knn.py | 153 | def show_prediction_labels_on_image(frame, predictions): | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | examples/web_service_example.py | 35 | # Check if a valid image file was uploaded | COMMENT |
| LOW | examples/facerec_from_webcam.py | 70 | # Display the resulting image | COMMENT |
| LOW | examples/facerec_from_webcam_faster.py | 79 | # Display the results | COMMENT |
| LOW | examples/facerec_from_webcam_faster.py | 95 | # Display the resulting image | COMMENT |
| LOW | examples/face_recognition_knn.py | 180 | # Display the resulting image | COMMENT |
| LOW | examples/face_recognition_knn.py | 201 | # Print results on the console | COMMENT |
| LOW | examples/face_recognition_knn.py | 205 | # Display results overlaid on an image | COMMENT |
| LOW | examples/blur_faces_on_webcam.py | 26 | # Display the results | COMMENT |
| LOW | examples/blur_faces_on_webcam.py | 43 | # Display the resulting image | COMMENT |
| LOW | examples/identify_and_draw_boxes_on_faces.py | 69 | # Display the resulting image | COMMENT |
| LOW | examples/facerec_from_webcam_multiprocessing.py | 201 | # Display the resulting image | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | docs/conf.py | 1 | #!/usr/bin/env python | COMMENT |
| LOW | docs/conf.py | 61 | #source_encoding = 'utf-8-sig' | COMMENT |
| LOW | docs/conf.py | 81 | #language = None | COMMENT |
| LOW | docs/conf.py | 101 | # unit titles (such as .. function::). | COMMENT |
| LOW | docs/conf.py | 121 | # The theme to use for HTML and HTML Help pages. See the documentation for | COMMENT |
| LOW | docs/conf.py | 141 | # The name of an image file (relative to this directory) to place at the | COMMENT |
| LOW | docs/conf.py | 161 | # typographically correct entities. | COMMENT |
| LOW | docs/conf.py | 181 | #html_show_sourcelink = True | COMMENT |
| LOW | docs/conf.py | 221 | u'Face Recognition Documentation', | COMMENT |
| LOW | docs/conf.py | 281 | #texinfo_show_urls = 'footnote' | COMMENT |
| LOW | examples/web_service_example_Simplified_Chinese.py | 1 | # 这是一个非常简单的使用Web服务上传图片运行人脸识别的案例,后端服务器会识别这张图片是不是奥巴马,并把识别结果以json键值对输出 | COMMENT |
| LOW | examples/web_service_example.py | 1 | # This is a _very simple_ example of a web service that recognizes faces in uploaded images. | COMMENT |
| LOW | examples/find_faces_in_batches.py | 1 | import face_recognition | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | face_recognition/__init__.py | 7 | CODE | |
| LOW | face_recognition/__init__.py | 7 | CODE | |
| LOW | face_recognition/__init__.py | 7 | CODE | |
| LOW | face_recognition/__init__.py | 7 | CODE | |
| LOW | face_recognition/__init__.py | 7 | CODE | |
| LOW | face_recognition/__init__.py | 7 | CODE | |
| LOW | face_recognition/__init__.py | 7 | CODE | |
| LOW | face_recognition/face_detection_cli.py | 2 | CODE | |
| LOW | face_recognition/face_recognition_cli.py | 2 | CODE | |
| LOW | examples/blink_detection.py | 16 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | examples/facerec_from_webcam.py | 51 | # If a match was found in known_face_encodings, just use the first one. | COMMENT |
| LOW | examples/facerec_from_webcam_faster.py | 63 | # # If a match was found in known_face_encodings, just use the first one. | COMMENT |
| LOW | examples/identify_and_draw_boxes_on_faces.py | 46 | # If a match was found in known_face_encodings, just use the first one. | COMMENT |
| LOW | examples/facerec_from_webcam_multiprocessing.py | 94 | # If a match was found in known_face_encodings, just use the first one. | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | examples/face_recognition_knn.py | 46 | CODE | |
| LOW | examples/facerec_ipcamera_knn.py | 51 | CODE | |
| LOW | examples/blink_detection.py | 21 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | examples/facerec_on_raspberry_pi.py | 14 | # If this fails, make sure you have a camera connected to the RPi and that you | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | face_recognition/api.py | 10 | except Exception: | CODE |