Repository Analysis

huggingface/pytorch-image-models

The largest collection of PyTorch image encoders / backbones. Including train, eval, inference, export scripts, and pretrained weights -- ResNet, ResNeXT, EfficientNet, NFNet, Vision Transformer (ViT), MobileNetV4, MobileNet-V3 & V2, RegNet, DPN, CSPNet, Swin Transformer, MaxViT, CoAtNet, ConvNeXt, and more

8.2 Low AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of huggingface/pytorch-image-models, a Python project with 36,981 GitHub stars. SynthScan v2.0 examined 337,290 lines of code across 356 source files, recording 2077 pattern matches distributed across 18 syntactic categories. The overall adjusted score of 8.2 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).

8.2
Adjusted Score
8.2
Raw Score
100%
Time Factor
2026-07-13
Last Push
37.0K
Stars
Python
Language
337.3K
Lines of Code
356
Files
2.1K
Pattern Hits
2026-07-14
Scan Date
0.60
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 4HIGH 208MEDIUM 35LOW 1830

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 2077 distinct pattern matches across 18 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.

Cross-File Repetition196 hits · 980 pts
SeverityFileLineSnippetContext
HIGHtimm/optim/mars.py0perform a single optimization step. args: closure (callable, optional): a closure that reevaluates the model and returnsSTRING
HIGHtimm/optim/lamb.py0perform a single optimization step. args: closure (callable, optional): a closure that reevaluates the model and returnsSTRING
HIGHtimm/optim/adafactor.py0perform a single optimization step. args: closure (callable, optional): a closure that reevaluates the model and returnsSTRING
HIGHtimm/optim/nvnovograd.py0perform a single optimization step. args: closure (callable, optional): a closure that reevaluates the model and returnsSTRING
HIGHtimm/optim/adabelief.py0perform a single optimization step. args: closure (callable, optional): a closure that reevaluates the model and returnsSTRING
HIGHtimm/optim/adamw.py0perform a single optimization step. args: closure (callable, optional): a closure that reevaluates the model and returnsSTRING
HIGHtimm/optim/laprop.py0perform a single optimization step. args: closure (callable, optional): a closure that reevaluates the model and returnsSTRING
HIGHtimm/optim/nadam.py0perform a single optimization step. args: closure (callable, optional): a closure that reevaluates the model and returnsSTRING
HIGHtimm/optim/rmsprop_tf.py0perform a single optimization step. args: closure (callable, optional): a closure that reevaluates the model and returnsSTRING
HIGHtimm/optim/madgrad.py0perform a single optimization step. args: closure (callable, optional): a closure that reevaluates the model and returnsSTRING
HIGHtimm/optim/sgdw.py0perform a single optimization step. args: closure (callable, optional): a closure that reevaluates the model and returnsSTRING
HIGHtimm/optim/lars.py0perform a single optimization step. args: closure (callable, optional): a closure that reevaluates the model and returnsSTRING
HIGHtimm/optim/nadamw.py0perform a single optimization step. args: closure (callable, optional): a closure that reevaluates the model and returnsSTRING
HIGHtimm/optim/adopt.py0perform a single optimization step. args: closure (callable, optional): a closure that reevaluates the model and returnsSTRING
HIGHtimm/models/repvit.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/tiny_vit.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/ghostnet.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/davit.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/efficientvit_mit.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/rexnet.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/edgenext.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/swiftformer.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/nest.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/regnet.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/resnetv2.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/efficientvit_msra.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/shvit.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/tresnet.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/fastvit.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/fasternet.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/efficientformer.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/levit.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/vovnet.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/inception_v4.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/maxxvit.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/metaformer.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/repghost.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/swin_transformer_v2.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/pvt_v2.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/mambaout.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/gcvit.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/starnet.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/inception_next.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/focalnet.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/pit.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/swin_transformer_v2_cr.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/efficientformer_v2.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/nextvit.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/hgnet.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/volo.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/xcit.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/mvitv2.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/twins.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/vision_transformer_sam.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/hiera.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/hieradet_sam2.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/vision_transformer_relpos.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/byobnet.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/tnt.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
HIGHtimm/models/rdnet.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if an int, if is a STRING
136 more matches not shown…
Unused Imports776 hits · 534 pts
SeverityFileLineSnippetContext
LOWlegacy_train.py53CODE
LOWtrain.py60CODE
LOWinference.py9CODE
LOWclean_checkpoint.py15CODE
LOWtests/test_scheduler.py18CODE
LOWtests/test_models.py30CODE
LOWtimm/__init__.py1CODE
LOWtimm/__init__.py2CODE
LOWtimm/__init__.py2CODE
LOWtimm/__init__.py2CODE
LOWtimm/__init__.py2CODE
LOWtimm/__init__.py8CODE
LOWtimm/__init__.py8CODE
LOWtimm/__init__.py8CODE
LOWtimm/__init__.py8CODE
LOWtimm/__init__.py8CODE
LOWtimm/__init__.py8CODE
LOWtimm/__init__.py8CODE
LOWtimm/__init__.py8CODE
LOWtimm/__init__.py8CODE
LOWtimm/layers/squeeze_excite.py13CODE
LOWtimm/layers/classifier.py11CODE
LOWtimm/layers/create_act.py4CODE
LOWtimm/layers/create_act.py4CODE
LOWtimm/layers/create_act.py6CODE
LOWtimm/layers/create_act.py7CODE
LOWtimm/layers/create_norm.py9CODE
LOWtimm/layers/separable_conv.py8CODE
LOWtimm/layers/trace_utils.py2CODE
LOWtimm/layers/__init__.py1CODE
LOWtimm/layers/__init__.py1CODE
LOWtimm/layers/__init__.py1CODE
LOWtimm/layers/__init__.py1CODE
LOWtimm/layers/__init__.py1CODE
LOWtimm/layers/__init__.py1CODE
LOWtimm/layers/__init__.py1CODE
LOWtimm/layers/__init__.py1CODE
LOWtimm/layers/__init__.py11CODE
LOWtimm/layers/__init__.py12CODE
LOWtimm/layers/__init__.py12CODE
LOWtimm/layers/__init__.py12CODE
LOWtimm/layers/__init__.py12CODE
LOWtimm/layers/__init__.py18CODE
LOWtimm/layers/__init__.py18CODE
LOWtimm/layers/__init__.py18CODE
LOWtimm/layers/__init__.py18CODE
LOWtimm/layers/__init__.py19CODE
LOWtimm/layers/__init__.py19CODE
LOWtimm/layers/__init__.py19CODE
LOWtimm/layers/__init__.py20CODE
LOWtimm/layers/__init__.py20CODE
LOWtimm/layers/__init__.py21CODE
LOWtimm/layers/__init__.py21CODE
LOWtimm/layers/__init__.py22CODE
LOWtimm/layers/__init__.py22CODE
LOWtimm/layers/__init__.py23CODE
LOWtimm/layers/__init__.py23CODE
LOWtimm/layers/__init__.py23CODE
LOWtimm/layers/__init__.py23CODE
LOWtimm/layers/__init__.py24CODE
716 more matches not shown…
AI Structural Patterns441 hits · 440 pts
SeverityFileLineSnippetContext
LOWlegacy_train.py1076CODE
LOWbenchmark.py208CODE
LOWtrain.py1176CODE
LOWtimm/layers/std_conv.py35CODE
LOWtimm/layers/std_conv.py76CODE
LOWtimm/layers/std_conv.py121CODE
LOWtimm/layers/std_conv.py182CODE
LOWtimm/layers/squeeze_excite.py30CODE
LOWtimm/layers/squeeze_excite.py109CODE
LOWtimm/layers/attention.py53CODE
LOWtimm/layers/attention.py158CODE
LOWtimm/layers/classifier.py226CODE
LOWtimm/layers/attention_pool2d.py36CODE
LOWtimm/layers/attention_pool2d.py187CODE
LOWtimm/layers/pos_embed_sincos.py168CODE
LOWtimm/layers/pos_embed_sincos.py86CODE
LOWtimm/layers/pos_embed_sincos.py337CODE
LOWtimm/layers/pos_embed_sincos.py404CODE
LOWtimm/layers/pos_embed_sincos.py542CODE
LOWtimm/layers/pos_embed_sincos.py1116CODE
LOWtimm/layers/separable_conv.py19CODE
LOWtimm/layers/separable_conv.py85CODE
LOWtimm/layers/gather_excite.py29CODE
LOWtimm/layers/non_local_attn.py153CODE
LOWtimm/layers/other_pool.py195CODE
LOWtimm/layers/other_pool.py286CODE
LOWtimm/layers/bottleneck_attn.py122CODE
LOWtimm/layers/bottleneck_attn.py185CODE
LOWtimm/layers/lambda_layer.py73CODE
LOWtimm/layers/lambda_layer.py171CODE
LOWtimm/layers/attention_pool.py20CODE
LOWtimm/layers/mlp.py19CODE
LOWtimm/layers/mlp.py63CODE
LOWtimm/layers/mlp.py120CODE
LOWtimm/layers/mlp.py171CODE
LOWtimm/layers/mlp.py218CODE
LOWtimm/layers/mlp.py256CODE
LOWtimm/layers/diff_attention.py37CODE
LOWtimm/layers/hybrid_embed.py28CODE
LOWtimm/layers/hybrid_embed.py228CODE
LOWtimm/layers/conv_bn_act.py16CODE
LOWtimm/layers/halo_attn.py142CODE
LOWtimm/layers/halo_attn.py247CODE
LOWtimm/layers/attention2d.py27CODE
LOWtimm/layers/attention2d.py107CODE
LOWtimm/layers/attention2d.py324CODE
LOWtimm/layers/patch_embed.py32CODE
LOWtimm/layers/patch_embed.py150CODE
LOWtimm/layers/eca.py61CODE
LOWtimm/layers/eca.py135CODE
LOWtimm/layers/global_context.py23CODE
LOWtimm/layers/split_attn.py38CODE
LOWtimm/layers/selective_kernel.py63CODE
LOWtimm/layers/cbam.py24CODE
LOWtimm/layers/cbam.py54CODE
LOWtimm/layers/cbam.py116CODE
LOWtimm/layers/cbam.py150CODE
LOWtimm/layers/cond_conv2d.py46CODE
LOWtimm/layers/cond_conv2d.py139CODE
LOWtimm/layers/norm_act.py64CODE
381 more matches not shown…
Hyper-Verbose Identifiers253 hits · 258 pts
SeverityFileLineSnippetContext
LOWtests/test_utils.py16def test_average_meter_zero_count():CODE
LOWtests/test_utils.py74def test_activation_stats_hook_validation():CODE
LOWtests/test_utils.py107def test_freeze_unfreeze_bn_root():CODE
LOWtests/test_utils.py124def test_activation_stats_functions():CODE
LOWtests/test_utils.py143def test_reparameterize_model():CODE
LOWtests/test_utils.py172def test_get_state_dict_custom_unwrap():CODE
LOWtests/test_utils.py190def test_freeze_unfreeze_string_input():CODE
LOWtests/test_task.py64def _param_group_weight_decay(optimizer):CODE
LOWtests/test_task.py72def test_task_checkpoint_omits_empty_task_state_and_keeps_legacy_paths(tmp_path):CODE
LOWtests/test_task.py103def test_feature_distillation_checkpoint_keeps_projection_in_task_state(tmp_path):CODE
LOWtests/test_task.py141def test_feature_distillation_trainable_module_optimizer_grouping():CODE
LOWtests/test_task.py167def test_base_eval_model_preserves_trainable_wrapper_for_use():CODE
LOWtests/test_task.py177def test_compiled_ema_eval_model_reflects_update():CODE
LOWtests/test_task.py202def test_compiled_eval_checkpoint_load_uses_unwrapped_state_dict_target():CODE
LOWtests/test_layers.py81def test_get_act_layer_empty_string():CODE
LOWtests/test_layers.py86def test_create_act_layer_inplace_error():CODE
LOWtests/test_layers.py98def test_create_act_layer_edge_cases():CODE
LOWtests/test_optim.py29def _test_basic_cases_template(weight, bias, input, constructor, scheduler_constructors):CODE
LOWtests/test_optim.py289def _build_params_dict_single(weight, bias, **kwargs):CODE
LOWtests/test_optim.py392def test_compiled_foreach_adam_optimizers(optimizer_name, foreach):CODE
LOWtests/test_optim.py434def test_compiled_muon_fallback(nesterov):CODE
LOWtests/test_optim.py615def test_param_groups_layer_decay_with_min():CODE
LOWtests/test_optim.py638def test_param_groups_layer_decay_with_matcher():CODE
LOWtests/test_optim.py665def test_param_groups_layer_decay_reg_token_stem(model_name):CODE
LOWtests/test_optim.py715def test_param_groups_weight_decay():CODE
LOWtests/test_scheduler.py70 def test_plateau_scheduler_step(self):CODE
LOWtests/test_scheduler.py122 def test_warmup_prefix_reaches_target_lr(self, scheduler_cls, kwargs):CODE
LOWtests/test_scheduler.py347 def test_state_dict_save_load(self, scheduler_cls, kwargs):CODE
LOWtests/test_scheduler.py368 def test_plateau_state_dict_save_load(self):CODE
LOWtests/test_scheduler.py400 def test_step_update_with_t_in_epochs_false(self, scheduler_cls, kwargs):CODE
LOWtests/test_scheduler.py430 def test_multiple_param_groups(self, scheduler_cls, kwargs):CODE
LOWtests/test_models.py412 def test_model_load_pretrained(model_name, batch_size):CODE
LOWtests/test_models.py421 def test_model_features_pretrained(model_name, batch_size):CODE
LOWtests/test_models.py431def test_model_forward_torchscript(model_name, batch_size):CODE
LOWtests/test_models.py341def test_model_default_cfgs_non_std(model_name, batch_size):CODE
LOWtests/test_models.py461def test_model_forward_features(model_name, batch_size):CODE
LOWtests/test_models.py492def test_model_forward_intermediates_features(model_name, batch_size):CODE
LOWtests/test_models.py523def test_model_forward_intermediates(model_name, batch_size):CODE
LOWtests/test_models.py712 def test_model_forward_fx_torchscript(model_name, batch_size):CODE
LOWtests/test_models.py737 def test_model_forward_torchscript_with_features_fx(model_name, batch_size):CODE
LOWtests/test_models.py766def _create_naflex_pos_embed_test_module(ar_preserving):CODE
LOWtests/test_models.py782def _create_naflex_pos_embed_test_inputs():CODE
LOWtests/test_models.py793def _naflex_dense_grid_sample_reference(module, x, patch_coord):CODE
LOWtests/test_models.py829def test_naflexvit_direct_grid_sample_parity(ar_preserving):CODE
LOWtests/test_models.py849def test_naflexvit_direct_grid_sample_fullgraph(ar_preserving):CODE
LOWtests/test_models.py867def test_naflexvit_direct_grid_sample_export(ar_preserving):CODE
LOWtests/test_models.py880def test_naflexvit_forward_intermediates_dict_input():CODE
LOWtests/test_models.py918def test_naflexvit_key_only_attn_mask_is_opt_in_and_post_patch_dropout():CODE
LOWtests/test_models.py953def test_naflexvit_key_only_attn_mask_output_parity(global_pool):CODE
LOWtests/test_checkpoint_loading.py23def test_weights_only_allows_argparse_namespace(tmp_path):CODE
LOWtests/test_checkpoint_loading.py36def test_weights_only_blocks_non_allowlisted_globals(tmp_path):CODE
LOWtests/test_checkpoint_loading.py52def test_resume_checkpoint_default_weights_only_namespace(tmp_path):CODE
LOWtests/test_checkpoint_loading.py82def test_resume_checkpoint_blocks_non_allowlisted_globals(tmp_path):CODE
LOWtests/test_checkpoint_loading.py95def test_resume_checkpoint_weights_only_false_allows_custom_globals(tmp_path):CODE
LOWtests/test_layers_drop.py125 def test_deprecated_args_accepted(self):CODE
LOWtests/test_layers_drop.py156 def test_couple_channels_parameter(self):CODE
LOWtests/test_layers_drop.py186 def test_no_drop_when_prob_zero(self):CODE
LOWtests/test_layers_drop.py192 def test_no_drop_when_not_training(self):CODE
LOWtests/test_layers_drop.py214 def test_drop_path_no_scaling(self):CODE
LOWtests/test_layers_pool.py78 def test_attention_pool_latent_basic(self):CODE
193 more matches not shown…
Deep Nesting149 hits · 147 pts
SeverityFileLineSnippetContext
LOWlegacy_train.py428CODE
LOWlegacy_train.py1076CODE
LOWlegacy_train.py1288CODE
LOWbenchmark.py163CODE
LOWbenchmark.py564CODE
LOWbenchmark.py620CODE
LOWbenchmark.py305CODE
LOWvalidate.py175CODE
LOWvalidate.py462CODE
LOWvalidate.py491CODE
LOWtrain.py460CODE
LOWtrain.py1176CODE
LOWtrain.py1392CODE
LOWbulk_runner.py96CODE
LOWbulk_runner.py141CODE
LOWinference.py151CODE
LOWinference.py373CODE
LOWresults/generate_csv_results.py20CODE
LOWtimm/layers/classifier.py282CODE
LOWtimm/layers/pos_embed_sincos.py1315CODE
LOWtimm/layers/gather_excite.py29CODE
LOWtimm/layers/non_local_attn.py71CODE
LOWtimm/layers/adaptive_avgmax_pool.py42CODE
LOWtimm/layers/adaptive_avgmax_pool.py127CODE
LOWtimm/layers/inplace_abn.py43CODE
LOWtimm/layers/pool1d.py4CODE
LOWtimm/layers/create_attn.py22CODE
LOWtimm/layers/weight_init.py110CODE
LOWtimm/layers/norm_act.py278CODE
LOWtimm/layers/norm_act.py322CODE
LOWtimm/scheduler/scheduler_factory.py63CODE
LOWtimm/optim/_param_groups.py19CODE
LOWtimm/optim/sgdw.py195CODE
LOWtimm/optim/sgdw.py241CODE
LOWtimm/optim/_optim_factory.py177CODE
LOWtimm/optim/lamb.py153CODE
LOWtimm/optim/adafactor.py128CODE
LOWtimm/optim/adafactor_bv.py210CODE
LOWtimm/optim/adafactor_bv.py123CODE
LOWtimm/optim/lars.py76CODE
LOWtimm/optim/nvnovograd.py67CODE
LOWtimm/optim/adamp.py90CODE
LOWtimm/optim/adabelief.py107CODE
LOWtimm/optim/adamw.py103CODE
LOWtimm/optim/kron.py400CODE
LOWtimm/optim/kron.py218CODE
LOWtimm/optim/radam.py38CODE
LOWtimm/optim/laprop.py80CODE
LOWtimm/optim/muon.py531CODE
LOWtimm/optim/muon.py783CODE
LOWtimm/optim/rmsprop_tf.py100CODE
LOWtimm/optim/sgdp.py50CODE
LOWtimm/optim/madgrad.py91CODE
LOWtimm/utils/model.py111CODE
LOWtimm/utils/model.py233CODE
LOWtimm/utils/model.py237CODE
LOWtimm/models/davit.py470CODE
LOWtimm/models/inception_resnet_v2.py299CODE
LOWtimm/models/inception_resnet_v2.py303CODE
LOWtimm/models/hrnet.py439CODE
89 more matches not shown…
Modern Structural Boilerplate145 hits · 146 pts
SeverityFileLineSnippetContext
LOWtimm/layers/attention.py12__all__ = ['Attention', 'AttentionRope', 'maybe_add_mask', 'resolve_self_attn_mask']CODE
LOWtimm/layers/config.py9__all__ = [CODE
LOWtimm/layers/_fx.py15__all__ = [CODE
LOWtimm/layers/typing.py7__all__ = ["LayerType", "PadType", "nullwrap", "disable_compiler"]CODE
LOWtimm/scheduler/scheduler.py91 def update_groups(self, values: Union[float, List[float]]) -> None:CODE
LOWtimm/optim/_types.py29__all__ = ['ParamsT', 'OptimType', 'OptimizerCallable']CODE
LOWtimm/optim/sgdw.py22__all__ = ['SGDW', 'sgdw']CODE
LOWtimm/optim/adopt.py26__all__ = ["Adopt", "adopt"]CODE
LOWtimm/models/repvit.py29__all__ = ['RepVit']CODE
LOWtimm/models/tiny_vit.py9__all__ = ['TinyVit']CODE
LOWtimm/models/deit.py25__all__ = ['VisionTransformerDistilled'] # model_registry will add each entrypoint fn to thisCODE
LOWtimm/models/ghostnet.py30__all__ = ['GhostNet']CODE
LOWtimm/models/volo.py36__all__ = ['VOLO'] # model_registry will add each entrypoint fn to thisCODE
LOWtimm/models/volo.py922 def set_grad_checkpointing(self, enable: bool = True) -> None:CODE
LOWtimm/models/davit.py31__all__ = ['DaVit']CODE
LOWtimm/models/efficientvit_mit.py9__all__ = ['EfficientVit', 'EfficientVitLarge']CODE
LOWtimm/models/gemma4_vit.py29__all__ = ['Gemma4VitEncoder', 'Gemma4VitClassifier']CODE
LOWtimm/models/gemma4_vit.py787 def set_grad_checkpointing(self, enable: bool = True) -> None:CODE
LOWtimm/models/gemma4_vit.py791 def set_clamp_enabled(self, enabled: bool = True) -> None:CODE
LOWtimm/models/gemma4_vit.py1120 def set_grad_checkpointing(self, enable: bool = True) -> None:CODE
LOWtimm/models/gemma4_vit.py1124 def set_clamp_enabled(self, enabled: bool = True) -> None:CODE
LOWtimm/models/_efficientnet_blocks.py26__all__ = [CODE
LOWtimm/models/selecsls.py22__all__ = ['SelecSls'] # model_registry will add each entrypoint fn to thisCODE
LOWtimm/models/rexnet.py28__all__ = ['RexNet'] # model_registry will add each entrypoint fn to thisCODE
LOWtimm/models/rexnet.py335 def set_grad_checkpointing(self, enable: bool = True) -> None:CODE
LOWtimm/models/inception_resnet_v2.py16__all__ = ['InceptionResnetV2']CODE
LOWtimm/models/edgenext.py36__all__ = ['EdgeNeXt'] # model_registry will add each entrypoint fn to thisCODE
LOWtimm/models/hrnet.py24__all__ = ['HighResolutionNet', 'HighResolutionNetFeatures'] # model_registry will add each entrypoint fn to thisCODE
LOWtimm/models/hieradet_sam2.py459 def set_grad_checkpointing(self, enable: bool = True) -> None:CODE
LOWtimm/models/vgg.py20__all__ = ['VGG']CODE
LOWtimm/models/vgg.py195 def set_grad_checkpointing(self, enable: bool = True) -> None:CODE
LOWtimm/models/byoanet.py22__all__ = []CODE
LOWtimm/models/convmixer.py15__all__ = ['ConvMixer']CODE
LOWtimm/models/swiftformer.py27__all__ = ['SwiftFormer']CODE
LOWtimm/models/nest.py49__all__ = ['Nest'] # model_registry will add each entrypoint fn to thisCODE
LOWtimm/models/cspnet.py28__all__ = ['CspNet'] # model_registry will add each entrypoint fn to thisCODE
LOWtimm/models/hardcorenas.py13__all__ = [] # model_registry will add each entrypoint fn to thisCODE
LOWtimm/models/beit.py70__all__ = ['Beit']CODE
LOWtimm/models/vision_transformer_relpos.py39__all__ = ['VisionTransformerRelPos'] # model_registry will add each entrypoint fn to thisCODE
LOWtimm/models/xcit.py30__all__ = ['Xcit'] # model_registry will add each entrypoint fn to thisCODE
LOWtimm/models/regnet.py42__all__ = ['RegNet', 'RegNetCfg'] # model_registry will add each entrypoint fn to thisCODE
LOWtimm/models/regnet.py714 def set_grad_checkpointing(self, enable: bool = True) -> None:CODE
LOWtimm/models/sequencer.py23__all__ = ['Sequencer2d'] # model_registry will add each entrypoint fn to thisCODE
LOWtimm/models/mvitv2.py33__all__ = ['MultiScaleVit', 'MultiScaleVitCfg'] # model_registry will add each entrypoint fn to thisCODE
LOWtimm/models/resnetv2.py47__all__ = ['ResNetV2'] # model_registry will add each entrypoint fn to thisCODE
LOWtimm/models/resnetv2.py664 def set_grad_checkpointing(self, enable: bool = True) -> None:CODE
LOWtimm/models/vision_transformer.py79__all__ = ['VisionTransformer'] # model_registry will add each entrypoint fn to thisCODE
LOWtimm/models/vision_transformer.py979 def set_grad_checkpointing(self, enable: bool = True) -> None:CODE
LOWtimm/models/efficientvit_msra.py9__all__ = ['EfficientVitMsra']CODE
LOWtimm/models/xception_aligned.py21__all__ = ['XceptionAligned']CODE
LOWtimm/models/shvit.py27__all__ = ['SHViT']CODE
LOWtimm/models/tresnet.py21__all__ = ['TResNet'] # model_registry will add each entrypoint fn to thisCODE
LOWtimm/models/senet.py27__all__ = ['SENet']CODE
LOWtimm/models/fastvit.py32__all__ = ['FastVit']CODE
LOWtimm/models/_efficientnet_builder.py23__all__ = ["EfficientNetBuilder", "BlockArgs", "decode_arch_def", "efficientnet_init_weights",CODE
LOWtimm/models/fasternet.py32__all__ = ['FasterNet']CODE
LOWtimm/models/efficientformer.py36__all__ = ['EfficientFormer'] # model_registry will add each entrypoint fn to thisCODE
LOWtimm/models/twins.py30__all__ = ['Twins'] # model_registry will add each entrypoint fn to thisCODE
LOWtimm/models/byobnet.py64__all__ = ['ByobNet', 'ByoModelCfg', 'ByoBlockCfg', 'create_byob_stem', 'create_block']CODE
LOWtimm/models/byobnet.py1635 def set_grad_checkpointing(self, enable: bool = True) -> None:CODE
85 more matches not shown…
Docstring Block Structure11 hits · 55 pts
SeverityFileLineSnippetContext
HIGHtimm/optim/_optim_factory.py161Get the OptimInfo for an optimizer. Args: name: Name of the optimizer Returns: STRING
HIGHtimm/optim/_optim_factory.py182Get the optimizer class with any default arguments applied. This allows direct instantiation of optimizers withSTRING
HIGHtimm/optim/_optim_factory.py245Create an optimizer instance. Args: model_or_params: Model or parameters to optimize opSTRING
HIGHtimm/optim/_optim_factory.py1107List available optimizer names, optionally filtered. List all registered optimizers, with optional filtering using STRING
HIGHtimm/optim/_optim_factory.py1148Get the OptimInfo for an optimizer. Args: name: Name of the optimizer Returns: OptimInfo confiSTRING
HIGHtimm/optim/_optim_factory.py1166Get optimizer class by name with option to bind default arguments. Retrieves the optimizer class or a partial functSTRING
HIGHtimm/optim/_optim_factory.py1215Create an optimizer instance via timm registry. Creates and configures an optimizer with appropriate parameter grouSTRING
HIGHtimm/optim/muon.py267Check if a parameter is suitable for Muon optimization. Args: param: Parameter tensor min_dim_size:STRING
HIGHtimm/models/_efficientnet_builder.py82 Decode block definition string Gets a list of block arg (dicts) through a string notation of arguments. E.g. iSTRING
HIGHtimm/data/auto_augment.py587 Create a AutoAugment transform Args: config_str: String defining configuration of auto augmentation. ConsiSTRING
HIGHtimm/data/auto_augment.py767 Create a RandAugment transform Args: config_str (str): String defining configuration of random augmentatioSTRING
Decorative Section Separators15 hits · 45 pts
SeverityFileLineSnippetContext
MEDIUMtimm/optim/lion.py22# ==============================================================================COMMENT
MEDIUMtimm/models/beit.py29# --------------------------------------------------------COMMENT
MEDIUMtimm/models/twins.py8# --------------------------------------------------------COMMENT
MEDIUMtimm/models/twins.py13# --------------------------------------------------------COMMENT
MEDIUMtimm/models/swin_transformer_v2.py9# --------------------------------------------------------COMMENT
MEDIUMtimm/models/swin_transformer_v2.py14# --------------------------------------------------------COMMENT
MEDIUMtimm/models/swin_transformer.py12# --------------------------------------------------------COMMENT
MEDIUMtimm/models/swin_transformer.py17# --------------------------------------------------------COMMENT
MEDIUMtimm/models/focalnet.py14# --------------------------------------------------------COMMENT
MEDIUMtimm/models/focalnet.py19# --------------------------------------------------------COMMENT
MEDIUMtimm/models/hiera.py11# --------------------------------------------------------COMMENT
MEDIUMtimm/models/hiera.py24# --------------------------------------------------------COMMENT
MEDIUMtimm/models/swin_transformer_v2_cr.py24# --------------------------------------------------------COMMENT
MEDIUMtimm/models/swin_transformer_v2_cr.py29# --------------------------------------------------------COMMENT
MEDIUMtimm/data/tf_preprocessing.py23# ==============================================================================COMMENT
Hallucination Indicators4 hits · 40 pts
SeverityFileLineSnippetContext
CRITICALtimm/models/hieradet_sam2.py426 self.head.fc.weight.data.mul_(head_init_scale)CODE
CRITICALtimm/models/hieradet_sam2.py427 self.head.fc.bias.data.mul_(head_init_scale)CODE
CRITICALtimm/models/hiera.py631 self.head.fc.weight.data.mul_(head_init_scale)CODE
CRITICALtimm/models/hiera.py632 self.head.fc.bias.data.mul_(head_init_scale)CODE
Over-Commented Block29 hits · 29 pts
SeverityFileLineSnippetContext
LOWtests/test_optim.py341 # _test_basic_cases(COMMENT
LOWtimm/layers/pos_embed_rel.py41COMMENT
LOWtimm/layers/patch_embed.py601 return outputCOMMENT
LOWtimm/layers/patch_embed.py621# embed_dim=768,COMMENT
LOWtimm/layers/patch_embed.py641# self.flatten = flattenCOMMENT
LOWtimm/layers/cond_conv2d.py121COMMENT
LOWtimm/optim/lion.py1""" Lion OptimizerCOMMENT
LOWtimm/optim/lamb.py21# Copyright (c) 2021, Habana Labs Ltd. All rights reserved.COMMENT
LOWtimm/optim/lamb.py41# Permission is hereby granted, free of charge, to any person obtaining a copyCOMMENT
LOWtimm/optim/adan.py1""" Adan OptimizerCOMMENT
LOWtimm/utils/distributed.py121 dist_backend = dist_backends.get(device_type, 'gloo')COMMENT
LOWtimm/models/volo.py1""" Vision OutLOoker (VOLO) implementationCOMMENT
LOWtimm/models/efficientvit_mit.py1161 hf_hub_id='timm/',COMMENT
LOWtimm/models/efficientvit_mit.py1261# def efficientvit_l0_sam(pretrained=False, **kwargs):COMMENT
LOWtimm/models/beit.py21primaryClass={cs.CV}COMMENT
LOWtimm/models/efficientvit_msra.py661COMMENT
LOWtimm/models/efficientvit_msra.py681# for k, v in tmp_dict.items():COMMENT
LOWtimm/models/shvit.py461COMMENT
LOWtimm/models/shvit.py481 # downsample_mapping[f'^stages\\.{i}\\.blocks\\.{j}\\.'] = f'stages.{i}.blocks.{j - 3}.'COMMENT
LOWtimm/models/fasternet.py401 # }COMMENT
LOWtimm/models/twins.py101 x = x[:, :H, :W, :].contiguous()COMMENT
LOWtimm/models/twins.py121 # x = x.reshape(B, _h, self.ws, _w, self.ws, C).transpose(2, 3) # B, _h, _w, ws, ws, CCOMMENT
LOWtimm/models/visformer.py521 attn_stage='011', spatial_conv='100', norm_layer=nn.BatchNorm2d, conv_init=True,COMMENT
LOWtimm/models/visformer.py541# model.default_cfg = _cfg()COMMENT
LOWtimm/models/visformer.py561#COMMENT
LOWtimm/models/visformer.py581# @register_modelCOMMENT
LOWtimm/models/hiera.py1""" An PyTorch implementation of HieraCOMMENT
LOWtimm/data/tf_preprocessing.py1""" Tensorflow Preprocessing AdapterCOMMENT
LOW.github/workflows/trufflehog.yml21 # unreachable), so we still fail on maybe-real secrets; 'unverified' (the noisyCOMMENT
Excessive Try-Catch Wrapping23 hits · 28 pts
SeverityFileLineSnippetContext
MEDIUMavg_checkpoints.py85 print("Error: Output filename ({}) already exists.".format(output))CODE
MEDIUMavg_checkpoints.py113 print('Error: No checkpoints found to average.')CODE
MEDIUMavg_checkpoints.py121 print(f"Error: Checkpoint ({c}) doesn't exist")CODE
LOWbulk_runner.py203 except Exception as e:CODE
MEDIUMclean_checkpoint.py42 print("Error: Output filename ({}) already exists.".format(args.output))CODE
MEDIUMclean_checkpoint.py110 print("Error: Checkpoint ({}) doesn't exist".format(checkpoint))CODE
LOWtests/test_models.py199 except Exception:CODE
LOWtests/test_models.py560 except Exception:CODE
LOWtimm/layers/blur_pool.py118 except Exception:CODE
LOWtimm/optim/lion.py159 except Exception:STRING
LOWtimm/optim/adan.py127 except Exception:CODE
MEDIUMtimm/optim/adan.py34def __init__(self, chunk_size):CODE
LOWtimm/optim/adamw.py216 except Exception:STRING
LOWtimm/optim/nadamw.py197 except Exception:STRING
LOWtimm/utils/jit.py33 except Exception:CODE
LOWtimm/utils/jit.py42 except Exception:CODE
LOWtimm/utils/checkpoint_saver.py122 except Exception as e:CODE
LOWtimm/utils/checkpoint_saver.py178 except Exception as e:CODE
LOWtimm/models/eva.py1237 except Exception as e:CODE
LOWtimm/models/_hub.py572 except Exception as _:CODE
LOWtimm/models/_helpers.py36 except Exception:CODE
LOWtimm/data/naflex_dataset.py550 except Exception as e:CODE
LOWtimm/data/readers/reader_wds.py57 except Exception as e:CODE
Redundant / Tautological Comments16 hits · 24 pts
SeverityFileLineSnippetContext
LOWlegacy_train.py689 # Check if we should use the NaFlex scheduled loaderCOMMENT
LOWlegacy_train.py753 # Check if we have model's patch size for NaFlex modeCOMMENT
LOWtrain.py671 # Check if we should use the NaFlex scheduled loaderCOMMENT
LOWtrain.py735 # Check if we have model's patch size for NaFlex modeCOMMENT
LOWtimm/layers/pos_embed_sincos.py682 # Check if we have pre-computed bandsCOMMENT
LOWtimm/layers/blur_pool.py143 # Check if aa_layer is a partial and already has device/dtype setCOMMENT
LOWtimm/optim/muon.py576 # Increment stepCOMMENT
LOWtimm/models/vision_transformer.py3072 # Check if we should use NaFlexVit insteadCOMMENT
LOWtimm/models/fastvit.py96 # Check if SE-ReLU is requestedCOMMENT
LOWtimm/models/naflexvit.py297 # Check if we need EVA block featuresCOMMENT
LOWtimm/models/naflexvit.py1982 # Check if it's a perfect square for a standard gridCOMMENT
LOWtimm/models/eva.py1306 # Check if we should use NaFlexVit implementationCOMMENT
LOWtimm/models/_hub.py419 # Check if README file already exist in repoCOMMENT
LOWtimm/models/_helpers.py111 # Check if safetensors or not and load weights accordinglyCOMMENT
LOWtimm/data/naflex_dataset.py119 # Check if patches are flattened or unflattenedCOMMENT
LOWconvert/convert_gemma4_vit.py97 # Check if this is a vision key (vision_tower or vision_model)COMMENT
Self-Referential Comments10 hits · 21 pts
SeverityFileLineSnippetContext
MEDIUMtimm/models/_factory.py85 >>> # Create a MobileNetV3-Large model with no pretrained weights.STRING
MEDIUMtimm/models/_factory.py88 >>> # Create a MobileNetV3-Large model with pretrained weights.STRING
MEDIUMtimm/models/_factory.py93 >>> # Create a MobileNetV3-Large model with pretrained weights and a new head with 10 classes.STRING
MEDIUMtimm/models/_factory.py98 >>> # Create a Dinov2 small model with pretrained weights and save weights in a custom directory.STRING
MEDIUMtimm/models/naflexvit.py1032 # Create the float mask and apply masking using additive mask conventionCOMMENT
MEDIUMtimm/models/hiera.py154 # Create a view of the tensor with the patch stride as separate dimsCOMMENT
MEDIUMtimm/models/swin_transformer_v2_cr.py98 r"""This class implements window-based Multi-Head-Attention with log-spaced continuous position bias.CODE
MEDIUMtimm/models/swin_transformer_v2_cr.py246 r"""This class implements the Swin transformer block.CODE
MEDIUMtimm/models/swin_transformer_v2_cr.py594 r"""This class implements a stage of the Swin transformer including multiple layers.CODE
MEDIUMtimm/data/naflex_loader.py422 # Create the collatorCOMMENT
AI Slop Vocabulary5 hits · 10 pts
SeverityFileLineSnippetContext
MEDIUMtimm/layers/norm_act.py156 # but ONLY when used in conjunction with the timm conversion function below.STRING
MEDIUMtimm/models/gemma4_vit.py1376 # so the test harness' size-clamp doesn't land at 128 and blow theCOMMENT
MEDIUMtimm/models/swin_transformer_v2_cr.py681 """ Updates the resolution to utilize and the window size and so the pair-wise relative positions.STRING
MEDIUMtimm/data/imagenet_info.py41 # which will be more robust than a guess based on num_classesCOMMENT
LOWtimm/data/naflex_dataset.py61 # If no divisor specified, just use integer divisionCOMMENT
Cross-Language Confusion1 hit · 2 pts
SeverityFileLineSnippetContext
HIGHtimm/models/naflexvit.py1620 spatial reshape is undefined); with ``output_dict=True`` the result also carries 'patch_valid'STRING
Slop Phrases1 hit · 2 pts
SeverityFileLineSnippetContext
LOWtimm/models/xception.py286 # The resize parameter of the validation transform should be 333, and make sure to center crop at 299x299COMMENT
Verbosity Indicators1 hit · 2 pts
SeverityFileLineSnippetContext
LOWtimm/data/naflex_transforms.py261 # Step 1: Get the maximum allowed dimensions from sequence length constraintCOMMENT
Structural Annotation Overuse1 hit · 2 pts
SeverityFileLineSnippetContext
LOWtimm/data/naflex_transforms.py261 # Step 1: Get the maximum allowed dimensions from sequence length constraintCOMMENT