AI Slop Code RIsk Monitor

ultralytics/yolov5

Ultralytics YOLOv5 in PyTorch for object detection, instance segmentation, classification, training, and export.

18.5 Elevated pattern signal View on GitHub

Maintenance and Governance Review

This report summarizes scanner evidence for ultralytics/yolov5, a Python project with 58,134 GitHub stars. SynthScan examined 24,989 lines of code across 131 source files, recording 238 pattern matches distributed across 16 syntactic categories. The legacy adjusted pattern signal is 18.5 (Elevated 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.

18.5
Adjusted Signal
18.5
Raw Pattern Score
100%
Time Factor
2026-10-06
Last Push
58.1K
Stars
Python
Language
25.0K
Lines of Code
131
Files
238
Pattern Hits
2026-10-12
Scan Date
0.40
HC Hit Rate

Risk Review · v3

Use each vector to guide manual verification of the underlying findings.

Cognitive Ownership Risk 52.3/100 · HIGH

Can maintainers explain intent, assumptions, and trade-offs? 167 finding(s).

Hallucinated Dependency & Supply Chain Risk 6.6/100 · LOW

Are imports declared and package/API names verified? 25 finding(s).

Agent Over-Engineering Ratio 17.1/100 · LOW

Are wrappers, guards, and repeated structures necessary? 82 finding(s).

PR Review Velocity Impact 64.0/100 · HIGH

Which changes need focused human review? 238 finding(s).

What These Metrics Mean

Adjusted Signal
Legacy pattern score normalized per 1,000 scanned lines and multiplied by the repository-level time factor. It is not an estimate of AI authorship.
Raw Pattern Score
Sum of severity- and context-weighted pattern findings before applying the time factor.
Time Factor
A coarse multiplier based on repository last-push metadata. It does not identify when individual code was written.
Pattern Hits
Count of configured pattern findings. Review each location and surrounding code before acting.
HC Hit Rate
High- and critical-severity findings per scanned file. Severity is a configured detector weight, not proof of a vulnerability or authorship.
Lines / Files
Scan coverage denominators used by the legacy normalized score.

Pattern-Signal History

This chart tracks the legacy adjusted pattern score across scan runs. Changes can reflect source changes, scan coverage, or detector/scoring versions; they do not measure AI adoption or prove that a team refactored code. Compare runs only when their scoring versions are compatible. The dashed line tracks the raw pattern-hit count.

Severity Breakdown

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.

CRITICAL 1HIGH 51MEDIUM 4LOW 182

Directory Score Breakdown

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.

Pattern Findings

The scanner identified 238 distinct pattern matches across 16 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.

Docstring Block Structure47 hits · 235 pts
SeverityFileLineSnippetContext
HIGHval.py66Saves a single JSON detection result, including image ID, category ID, bounding box, and confidence score. Args: STRING
HIGHval.py397Parse command-line options for configuring YOLOv5 model inference. Args: data (str, optional): Path to the STRING
HIGHval.py475Executes YOLOv5 tasks like training, validation, testing, speed, and study benchmarks based on provided options. ArSTRING
HIGHexport.py97Initializes an iOS compatible model with normalization based on image dimensions. Args: model (torcSTRING
HIGHexport.py123Run a forward pass on the input tensor, returning class confidences and normalized coordinates. Args: STRING
HIGHexport.py144Returns a DataFrame of supported YOLOv5 model export formats and their properties. Returns: pandas.DataFramSTRING
HIGHexport.py183Log success or failure, execution time, and file size for YOLOv5 model export functions wrapped with @try_export. ASTRING
HIGHexport.py226Export a YOLOv5 model to the TorchScript format. Args: model (torch.nn.Module): The YOLOv5 model to be expoSTRING
HIGHexport.py281Export a YOLOv5 model to ONNX format with dynamic axes support and optional model simplification. Args: modSTRING
HIGHexport.py379Export a YOLOv5 model to OpenVINO format with optional FP16 and INT8 quantization. Args: file (Path): Path STRING
HIGHexport.py463Export a YOLOv5 PyTorch model to PaddlePaddle format using X2Paddle, saving the converted model and metadata. Args:STRING
HIGHexport.py511Export a YOLOv5 model to CoreML format with optional NMS, INT8, and FP16 support. Args: model (torch.nn.ModSTRING
HIGHexport.py592Export a YOLOv5 model to TensorRT engine format, requiring GPU and TensorRT>=7.0.0. Args: model (torch.nn.MSTRING
HIGHexport.py711Export a YOLOv5 model to the TensorFlow SavedModel format, supporting dynamic axes and non-maximum suppression (NMS)STRING
HIGHexport.py794Export YOLOv5 model to TensorFlow GraphDef (*.pb) format. Args: keras_model (tf.keras.Model): The Keras modSTRING
HIGHexport.py831Export a YOLOv5 model to TensorFlow Lite format with optional INT8 quantization and NMS support. Args: keraSTRING
HIGHexport.py904Exports a YOLOv5 model to Edge TPU compatible TFLite format; requires Linux and Edge TPU compiler. Args: fiSTRING
HIGHexport.py989Convert a YOLOv5 model to TensorFlow.js format with optional uint8 quantization. Args: file (Path): Path toSTRING
HIGHexport.py1050Adds metadata to a TensorFlow Lite (TFLite) model file, supporting multiple outputs according to TensorFlow guidelinSTRING
HIGHexport.py1111Convert a PyTorch YOLOv5 model to CoreML format with Non-Maximum Suppression (NMS), handling different input/output STRING
HIGHexport.py1312Exports a YOLOv5 model to specified formats including ONNX, TensorRT, CoreML, and TensorFlow. Args: data (sSTRING
HIGHexport.py1492Parse command-line options for YOLOv5 model export configurations. Args: known (bool): If True, uses `argpaSTRING
HIGHtrain.py107Train a YOLOv5 model on a custom dataset using specified hyperparameters, options, and device, managing datasets, moSTRING
HIGHtrain.py534Parse command-line arguments for YOLOv5 training, validation, and testing. Args: known (bool, optional): IfSTRING
HIGHtrain.py603Runs the main entry point for training or hyperparameter evolution with specified options and optional callbacks. ASTRING
HIGHtrain.py878Generate an individual with random hyperparameters within specified ranges. Args: input_ranges (list[tuple[STRING
HIGHtrain.py908Execute YOLOv5 training with specified options, allowing optional overrides through keyword arguments. Args: STRING
HIGHhubconf.py17Creates or loads a YOLOv5 model, with options for pretrained weights and model customization. Args: name (sSTRING
HIGHhubconf.py110Loads a custom or local YOLOv5 model from a given path with optional autoshaping and device specification. Args: STRING
HIGHhubconf.py141Instantiates the YOLOv5-nano model with options for pretraining, input channels, class count, autoshaping, verbositySTRING
HIGHhubconf.py177Create a YOLOv5-small (yolov5s) model with options for pretraining, input channels, class count, autoshaping, verbosSTRING
HIGHhubconf.py218Instantiates the YOLOv5-medium model with customizable pretraining, channel count, class count, autoshaping, verbosiSTRING
HIGHhubconf.py251Creates YOLOv5-large model with options for pretraining, channels, classes, autoshaping, verbosity, and device selecSTRING
HIGHhubconf.py281Create the YOLOv5-xlarge model with options for pretraining, input channels, class count, autoshaping, verbosity, anSTRING
HIGHhubconf.py311Creates YOLOv5-nano-P6 model with options for pretraining, channels, classes, autoshaping, verbosity, and device. ASTRING
HIGHhubconf.py338Instantiate the YOLOv5-small-P6 model with options for pretraining, input channels, number of classes, autoshaping, STRING
HIGHhubconf.py375Create YOLOv5-medium-P6 model with options for pretraining, channel count, class count, autoshaping, verbosity, and STRING
HIGHhubconf.py409Instantiate the YOLOv5-large-P6 model with options for pretraining, channel and class counts, autoshaping, verbositySTRING
HIGHhubconf.py441Creates the YOLOv5-xlarge-P6 model with options for pretraining, number of input channels, class count, autoshaping,STRING
HIGHdetect.py101Runs YOLOv5 detection inference on various sources like images, videos, directories, streams, etc. Args: weSTRING
HIGHdetect.py328Parse command-line arguments for YOLOv5 detection, allowing custom inference options and model configurations. ArgsSTRING
HIGHdetect.py412Executes YOLOv5 model inference based on provided command-line arguments, validating dependencies before running. ASTRING
HIGHbenchmarks.py62Run YOLOv5 benchmarks on multiple export formats and log results for model performance evaluation. Args: weSTRING
HIGHbenchmarks.py157Run YOLOv5 export tests for all supported formats and log the results, including export statuses. Args: weiSTRING
HIGHbenchmarks.py214Parses command-line arguments for YOLOv5 model inference configuration. Args: weights (str): The path to thSTRING
HIGHbenchmarks.py252Executes YOLOv5 benchmark tests or main training/inference routines based on the provided command-line arguments. ASTRING
HIGHutils/autoanchor.py68Creates kmeans-evolved anchors from training dataset. Args: dataset: path to data.yaml, or a loaded datasetSTRING
Excessive Try-Catch Wrapping40 hits · 40 pts
SeverityFileLineSnippetContext
LOWval.py382 except Exception as e:CODE
LOWexport.py217 except Exception as e:CODE
LOWexport.py372 except Exception as e:CODE
LOWexport.py628 except Exception:CODE
LOWexport.py747 except Exception:CODE
LOWhubconf.py86 except Exception:CODE
LOWhubconf.py100 except Exception as e:CODE
LOWbenchmarks.py126 except Exception as e:CODE
LOWbenchmarks.py202 except Exception:CODE
LOWsegment/val.py381 except Exception as e:CODE
LOWtests/test_invariant_export.py104 except Exception:CODE
LOWutils/autobatch.py53 except Exception as e:CODE
LOWutils/dataloaders.py523 except Exception as e:CODE
LOWutils/dataloaders.py533 except Exception:CODE
LOWutils/dataloaders.py688 except Exception as e:CODE
LOWutils/dataloaders.py942 except Exception as e:CODE
LOWutils/downloads.py67 except Exception as e: # url2CODE
LOW⚡utils/downloads.py109 except Exception:CODE
LOW⚡utils/downloads.py112 except Exception:CODE
LOW⚡utils/downloads.py115 except Exception:CODE
LOWutils/plots.py300 except Exception as e:CODE
LOWutils/autoanchor.py141 except Exception:CODE
LOWutils/torch_utils.py177 except Exception:CODE
LOWutils/torch_utils.py188 except Exception: # no backward methodCODE
LOWutils/torch_utils.py198 except Exception as e:CODE
LOWutils/general.py211 except Exception:CODE
LOWutils/general.py288 except Exception as e:CODE
LOWutils/general.py432 except Exception:CODE
LOWutils/general.py910 except Exception:CODE
LOWutils/augmentations.py51 except Exception as e:CODE
LOWutils/augmentations.py293 except Exception as e:CODE
LOWutils/loggers/__init__.py437 except Exception as e:CODE
LOWutils/loggers/comet/comet_utils.py64 except Exception:CODE
LOWutils/segment/plots.py146 except Exception as e:CODE
LOWutils/flask_rest_api/restapi.py55 except Exception:CODE
LOWmodels/yolo.py489 except Exception as e:CODE
LOW.github/workflows/merge-main-into-prs.yml71 except Exception as update_error:CODE
LOW.github/workflows/merge-main-into-prs.yml77 except Exception as e:CODE
LOWdata/Objects365.yaml438 except Exception as e:CODE
LOWdata/xView.yaml136 except Exception as e:CODE
Deep Nesting38 hits · 38 pts
SeverityFileLineSnippetContext
LOWval.py112CODE
LOWval.py474CODE
LOWtrain.py106CODE
LOWtrain.py602CODE
LOWhubconf.py16CODE
LOWdetect.py71CODE
LOWclassify/val.py52CODE
LOWclassify/predict.py68CODE
LOWclassify/train.py78CODE
LOWsegment/val.py104CODE
LOWsegment/val.py428CODE
LOWsegment/predict.py71CODE
LOWsegment/train.py100CODE
LOWsegment/train.py577CODE
LOWutils/dataloaders.py897CODE
LOWutils/dataloaders.py268CODE
LOWutils/dataloaders.py475CODE
LOWutils/dataloaders.py798CODE
LOWutils/downloads.py81CODE
LOWutils/plots.py55CODE
LOWutils/torch_utils.py79CODE
LOWutils/torch_utils.py151CODE
LOWutils/torch_utils.py263CODE
LOWutils/general.py310CODE
LOWutils/general.py350CODE
LOWutils/general.py475CODE
LOWutils/general.py478CODE
LOWutils/augmentations.py248CODE
LOWutils/segment/dataloaders.py235CODE
LOWutils/segment/loss.py48CODE
LOWutils/segment/plots.py20CODE
LOWutils/segment/plots.py116CODE
LOWmodels/tf.py504CODE
LOWmodels/common.py459CODE
LOWmodels/common.py685CODE
LOWmodels/common.py880CODE
LOWmodels/common.py971CODE
LOWmodels/yolo.py375CODE
Redundant / Tautological Comments17 hits · 26 pts
SeverityFileLineSnippetContext
LOWval.py335 # Print resultsCOMMENT
LOWval.py341 # Print results per classCOMMENT
LOWdetect.py250 # Print resultsCOMMENT
LOWdetect.py315 # Print resultsCOMMENT
LOWbenchmarks.py134 # Print resultsCOMMENT
LOWbenchmarks.py205 # Print resultsCOMMENT
LOWclassify/val.py140 # Print resultsCOMMENT
LOWclassify/predict.py151 # Print resultsCOMMENT
LOWclassify/predict.py195 # Print resultsCOMMENT
LOWsegment/val.py334 # Print resultsCOMMENT
LOWsegment/val.py340 # Print results per classCOMMENT
LOWsegment/predict.py182 # Print resultsCOMMENT
LOWsegment/predict.py239 # Print resultsCOMMENT
LOWutils/loggers/comet/__init__.py163 # Check if running the Experiment with the Comet OptimizerCOMMENT
LOWutils/loggers/comet/__init__.py448 # Check if running Experiment with Comet OptimizerCOMMENT
LOWutils/loggers/clearml/clearml_utils.py146 # Set data to data_dict because wandb will crash without this information and opt is the best wayCOMMENT
LOW.github/workflows/merge-main-into-prs.yml59 # Check if PR is behind the default branchCOMMENT
Unused Imports23 hits · 23 pts
SeverityFileLineSnippetContext
LOWutils/triton.py4CODE
LOWutils/__init__.py6CODE
LOWutils/__init__.py6CODE
LOWutils/__init__.py6CODE
LOWutils/torch_utils.py21CODE
LOWutils/torch_utils.py24CODE
LOWutils/torch_utils.py24CODE
LOWutils/torch_utils.py24CODE
LOWutils/torch_utils.py17CODE
LOWutils/torch_utils.py19CODE
LOWutils/general.py4CODE
LOWutils/general.py42CODE
LOWutils/general.py43CODE
LOWutils/general.py43CODE
LOWutils/general.py51CODE
LOWutils/general.py51CODE
LOWutils/general.py51CODE
LOWutils/general.py53CODE
LOWutils/general.py53CODE
LOWutils/general.py53CODE
LOWutils/general.py53CODE
LOWutils/general.py63CODE
LOWutils/general.py63CODE
Over-Commented Block23 hits · 22 pts
SeverityFileLineSnippetContext
LOWrequirements.txt21# clearml>=1.2.0COMMENT
LOWrequirements.txt41# tritonclient[all]~=2.24.0COMMENT
LOWpyproject.toml1# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/licenseCOMMENT
LOWexport.py1181 out0.type.multiArrayType.shape[:] = out0_shape # (3780, 80)COMMENT
LOWmodels/common.py461 # PyTorch: weights = *.ptCOMMENT
LOWdata/ImageNet1000.yaml1# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/licenseCOMMENT
LOWdata/coco128.yaml1# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/licenseCOMMENT
LOWdata/coco.yaml1# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/licenseCOMMENT
LOWdata/coco128-seg.yaml1# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/licenseCOMMENT
LOWdata/GlobalWheat2020.yaml1# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/licenseCOMMENT
LOWdata/VisDrone.yaml1# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/licenseCOMMENT
LOWdata/SKU-110K.yaml1# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/licenseCOMMENT
LOWdata/Objects365.yaml1# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/licenseCOMMENT
LOWdata/ImageNet10.yaml1# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/licenseCOMMENT
LOWdata/xView.yaml1# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/licenseCOMMENT
LOWdata/ImageNet100.yaml1# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/licenseCOMMENT
LOWdata/Argoverse.yaml1# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/licenseCOMMENT
LOWdata/ImageNet.yaml1# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/licenseCOMMENT
LOWdata/VOC.yaml1# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/licenseCOMMENT
LOWdata/hyps/hyp.VOC.yaml1# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/licenseCOMMENT
LOWdata/scripts/get_imagenet1000.sh1#!/bin/bashCOMMENT
LOWdata/scripts/get_imagenet100.sh1#!/bin/bashCOMMENT
LOWdata/scripts/get_imagenet10.sh1#!/bin/bashCOMMENT
Hyper-Verbose Identifiers18 hits · 20 pts
SeverityFileLineSnippetContext
LOWtests/test_invariant_export.py21def test_shell_injection_via_model_path(malicious_path):CODE
LOWtests/test_invariant_export.py40def test_export_edgetpu_no_shell_true():CODE
LOW⚡tests/test_flask_rest_api.py57def test_rejects_non_image_upload_with_allowed_extension(client):CODE
LOW⚡tests/test_flask_rest_api.py63def test_rejects_upload_with_disallowed_extension(client):CODE
LOW⚡tests/test_flask_rest_api.py69def test_rejects_oversized_upload(client):CODE
LOW⚡tests/test_flask_rest_api.py75def test_accepts_valid_image_upload(client):CODE
LOWtests/test_invariant_common.py42def test_ssrf_redirect_target_is_validated(monkeypatch):CODE
LOWtests/test_invariant_common.py72def test_scale_image_many_masks():CODE
LOWtests/test_invariant_common.py83def test_tensorrt_deserialize_failure_reports_environment(monkeypatch, tmp_path):CODE
LOWutils/triton.py36 def create_input_placeholders() -> list[InferInput]:CODE
LOWutils/dataloaders.py988def create_classification_dataloader(CODE
LOWutils/torch_utils.py79def reshape_classifier_output(model, n=1000):CODE
LOWutils/torch_utils.py103def torch_distributed_zero_first(local_rank: int):CODE
LOWutils/loggers/__init__.py154 def on_pretrain_routine_start(self):CODE
LOWutils/loggers/comet/__init__.py367 def download_dataset_artifact(self, artifact_path):CODE
LOWutils/loggers/comet/comet_utils.py21def download_model_checkpoint(opt, experiment):CODE
LOWutils/segment/metrics.py17def ap_per_class_box_and_mask(CODE
LOWmodels/tf.py707def representative_dataset_gen(dataset, ncalib=100):CODE
AI Structural Patterns18 hits · 16 pts
SeverityFileLineSnippetContext
LOWval.py112CODE
LOWexport.py697CODE
LOWexport.py1285CODE
LOWdetect.py71CODE
LOWbenchmarks.py51CODE
LOWbenchmarks.py146CODE
LOWclassify/val.py52CODE
LOWclassify/predict.py68CODE
LOWsegment/val.py104CODE
LOWsegment/predict.py71CODE
LOWutils/dataloaders.py106CODE
LOWutils/dataloaders.py475CODE
LOWutils/general.py658CODE
LOWutils/augmentations.py118CODE
LOWutils/augmentations.py248CODE
LOWutils/segment/dataloaders.py21CODE
LOWutils/segment/dataloaders.py89CODE
LOWutils/segment/augmentations.py26CODE
Empty Error Handlers3 hits · 15 pts
SeverityFileLineSnippetContext
HIGHtests/test_invariant_export.py104except Exception:CODE
HIGHutils/augmentations.py49except ImportError: # package not installed, skipCODE
HIGHmodels/tf.py526except NameError:CODE
Hallucination Indicators1 hit · 10 pts
SeverityFileLineSnippetContext
CRITICALexport.py1263 pipeline.spec.description.metadata.userDefined.update(CODE
Self-Referential Comments2 hits · 6 pts
SeverityFileLineSnippetContext
MEDIUMtrain.py837 # Create the next generation through crossover and mutationCOMMENT
MEDIUMdetect.py188 # Define the path for the CSV fileCOMMENT
AI Slop Vocabulary2 hits · 4 pts
SeverityFileLineSnippetContext
MEDIUMpyproject.toml14# For comprehensive documentation and usage instructions, visit: https://docs.ultralytics.com/yolov5COMMENT
MEDIUMmodels/common.py844 """AutoShape class for robust YOLOv5 inference with preprocessing, NMS, and support for various input formats."""STRING
Modern Structural Boilerplate3 hits · 3 pts
SeverityFileLineSnippetContext
LOWutils/loggers/comet/__init__.py10logger = logging.getLogger(__name__)CODE
LOWutils/loggers/comet/comet_utils.py14logger = logging.getLogger(__name__)CODE
LOWutils/loggers/comet/hpo.py12logger = logging.getLogger(__name__)CODE
Example Usage Blocks1 hit · 2 pts
SeverityFileLineSnippetContext
LOWutils/autobatch.py21 # Usage:COMMENT
TODO Padding1 hit · 2 pts
SeverityFileLineSnippetContext
LOWutils/augmentations.py275 # TODO: implement AugMix, AutoAug & RandAug in albumentationCOMMENT
Cross-Language Confusion1 hit · 1 pts
SeverityFileLineSnippetContext
HIGHexport.py41 $ cd .. && git clone https://github.com/zldrobit/tfjs-yolov5-example.git && cd tfjs-yolov5-exampleSTRING