The repository provides code for running inference with the SegmentAnything Model (SAM), links for downloading the trained model checkpoints, and example notebooks that show how to use the model.
This report summarizes scanner evidence for facebookresearch/segment-anything, a Jupyter Notebook project with 55,189 GitHub stars. SynthScan examined 4,328 lines of code across 43 source files, recording 28 pattern matches distributed across 7 syntactic categories. The legacy adjusted pattern signal is 8.8 (Moderate pattern signal); it is not an authorship estimate.
Use the findings to ask whether maintainers can explain intent, verify dependencies, simplify unnecessary scaffolding, and focus review effort. Risk Payload v1 adds ownership, supply-chain, over-engineering, and review-effort vectors when available. These are prompts for human verification, not probabilities, security findings, or measured maintenance costs.
Use each vector to guide manual verification of the underlying findings.
Payload schema: 1.0.0 · Engine: 2.0.0 · Scoring: heuristic-density-v1 · Scan date: 2026-11-27.
Can maintainers explain intent, assumptions, and trade-offs? 13 finding(s).
Are imports declared and package/API names verified? 15 finding(s).
Are wrappers, guards, and repeated structures necessary? 8 finding(s).
Which changes need focused human review? 28 finding(s).
Run additional scans to build a history of the legacy pattern signal. Score changes are not a measure of AI adoption or code quality.
Groups findings by configured severity weight. Severity is not a confidence estimate, security rating, or proof that a package is missing. Verify imports against the project's manifests and inspect each finding in its local design context.
This horizontal bar chart shows where configured pattern scores accumulate across directories. Treat the bars as locations to inspect, not as evidence of authorship or code quality. Use the file-level findings to decide whether a directory needs a focused ownership, dependency, complexity, or review check.
The scanner identified 28 distinct pattern matches across 7 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a detector match to inspect in context. 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 configured finding weight (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — legacy comment-context matches receive a ×1.5 score weight. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier under the legacy scoring model.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | segment_anything/automatic_mask_generator.py | 118 | CODE | |
| LOW | segment_anything/automatic_mask_generator.py | 121 | CODE | |
| LOW | segment_anything/__init__.py | 7 | CODE | |
| LOW | segment_anything/__init__.py | 7 | CODE | |
| LOW | segment_anything/__init__.py | 7 | CODE | |
| LOW | segment_anything/__init__.py | 7 | CODE | |
| LOW | segment_anything/__init__.py | 7 | CODE | |
| LOW | segment_anything/__init__.py | 14 | CODE | |
| LOW | segment_anything/__init__.py | 15 | CODE | |
| LOW | segment_anything/modeling/__init__.py | 7 | CODE | |
| LOW | segment_anything/modeling/__init__.py | 8 | CODE | |
| LOW | segment_anything/modeling/__init__.py | 9 | CODE | |
| LOW | segment_anything/modeling/__init__.py | 10 | CODE | |
| LOW | segment_anything/modeling/__init__.py | 11 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| CRITICAL | segment_anything/utils/onnx.py | 73 | ) * self.model.prompt_encoder.no_mask_embed.weight.reshape(1, -1, 1, 1) | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | segment_anything/automatic_mask_generator.py | 324 | def postprocess_small_regions( | CODE |
| LOW | segment_anything/utils/amg.py | 156 | def calculate_stability_score( | CODE |
| LOW | segment_anything/utils/amg.py | 189 | def build_all_layer_point_grids( | CODE |
| LOW | segment_anything/utils/onnx.py | 42 | def resize_longest_image_size( | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | segment_anything/automatic_mask_generator.py | 36 | CODE | |
| LOW | segment_anything/modeling/transformer.py | 240 | CODE | |
| LOW | segment_anything/modeling/image_encoder.py | 18 | CODE | |
| LOW | segment_anything/modeling/image_encoder.py | 122 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | segment_anything/utils/amg.py | 240 | # Check if boxes has a channel dimension | COMMENT |
| LOW | segment_anything/utils/amg.py | 249 | # Check if points has a channel dimension | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | segment_anything/utils/amg.py | 44 | CODE | |
| LOW | segment_anything/utils/amg.py | 59 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | segment_anything/utils/__init__.py | 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. | COMMENT |