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

7.1 Low AI signal View on GitHub
7.1
Adjusted Score
7.1
Raw Score
100%
Time Factor
2026-05-27
Last Push
36,842
Stars
Python
Language
336,474
Lines of Code
355
Files
1509
Pattern Hits
2026-05-31
Scan Date

Score History

Severity Breakdown

CRITICAL 4HIGH 254MEDIUM 35LOW 1216

Pattern Findings

1509 matches across 14 categories. Click a row to expand file-level details.

Cross-File Repetition243 hits · 1215 pts
SeverityFileLineSnippet
HIGHtests/test_models.py0run a single forward pass with each model in feature extraction mode
HIGHtests/test_models.py0run a single forward pass with each model in feature extraction mode
HIGHtests/test_models.py0run a single forward pass with each model in feature extraction mode
HIGHtimm/layers/activations.py0applies the gaussian error linear units function (w/ dummy inplace arg)
HIGHtimm/layers/activations.py0applies the gaussian error linear units function (w/ dummy inplace arg)
HIGHtimm/layers/activations.py0applies the gaussian error linear units function (w/ dummy inplace arg)
HIGHtimm/layers/norm_act.py0rmsnorm + activation for '2d' nchw tensors note: it's currently (2025-05-10) faster to use an eager 2d kernel that does
HIGHtimm/layers/norm_act.py0rmsnorm + activation for '2d' nchw tensors note: it's currently (2025-05-10) faster to use an eager 2d kernel that does
HIGHtimm/layers/norm_act.py0rmsnorm + activation for '2d' nchw tensors note: it's currently (2025-05-10) faster to use an eager 2d kernel that does
HIGHtimm/layers/norm_act.py0rmsnorm + activation for '2d' nchw tensors note: it's currently (2025-05-10) faster to use an eager 2d kernel that does
HIGHtimm/optim/mars.py0performs a single optimization step. arguments: closure (callable, optional): a closure that reevaluates the model and r
HIGHtimm/optim/lamb.py0performs a single optimization step. arguments: closure (callable, optional): a closure that reevaluates the model and r
HIGHtimm/optim/adafactor.py0performs a single optimization step. arguments: closure (callable, optional): a closure that reevaluates the model and r
HIGHtimm/optim/nvnovograd.py0performs a single optimization step. arguments: closure (callable, optional): a closure that reevaluates the model and r
HIGHtimm/optim/adabelief.py0performs a single optimization step. arguments: closure (callable, optional): a closure that reevaluates the model and r
HIGHtimm/optim/adamw.py0performs a single optimization step. arguments: closure (callable, optional): a closure that reevaluates the model and r
HIGHtimm/optim/laprop.py0performs a single optimization step. arguments: closure (callable, optional): a closure that reevaluates the model and r
HIGHtimm/optim/nadam.py0performs a single optimization step. arguments: closure (callable, optional): a closure that reevaluates the model and r
HIGHtimm/optim/rmsprop_tf.py0performs a single optimization step. arguments: closure (callable, optional): a closure that reevaluates the model and r
HIGHtimm/optim/madgrad.py0performs a single optimization step. arguments: closure (callable, optional): a closure that reevaluates the model and r
HIGHtimm/optim/sgdw.py0performs a single optimization step. args: closure (callable, optional): a closure that reevaluates the model and return
HIGHtimm/optim/lars.py0performs a single optimization step. args: closure (callable, optional): a closure that reevaluates the model and return
HIGHtimm/optim/nadamw.py0performs a single optimization step. args: closure (callable, optional): a closure that reevaluates the model and return
HIGHtimm/models/repvit.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if int, all if none
HIGHtimm/models/tiny_vit.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if int, all if none
HIGHtimm/models/ghostnet.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if int, all if none
HIGHtimm/models/davit.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if int, all if none
HIGHtimm/models/efficientvit_mit.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if int, all if none
HIGHtimm/models/efficientvit_mit.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if int, all if none
HIGHtimm/models/rexnet.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if int, all if none
HIGHtimm/models/edgenext.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if int, all if none
HIGHtimm/models/swiftformer.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if int, all if none
HIGHtimm/models/nest.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if int, all if none
HIGHtimm/models/regnet.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if int, all if none
HIGHtimm/models/resnetv2.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if int, all if none
HIGHtimm/models/efficientvit_msra.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if int, all if none
HIGHtimm/models/shvit.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if int, all if none
HIGHtimm/models/tresnet.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if int, all if none
HIGHtimm/models/fastvit.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if int, all if none
HIGHtimm/models/fasternet.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if int, all if none
HIGHtimm/models/efficientformer.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if int, all if none
HIGHtimm/models/levit.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if int, all if none
HIGHtimm/models/vovnet.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if int, all if none
HIGHtimm/models/inception_v4.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if int, all if none
HIGHtimm/models/maxxvit.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if int, all if none
HIGHtimm/models/metaformer.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if int, all if none
HIGHtimm/models/repghost.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if int, all if none
HIGHtimm/models/swin_transformer_v2.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if int, all if none
HIGHtimm/models/pvt_v2.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if int, all if none
HIGHtimm/models/mambaout.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if int, all if none
HIGHtimm/models/gcvit.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if int, all if none
HIGHtimm/models/starnet.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if int, all if none
HIGHtimm/models/inception_next.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if int, all if none
HIGHtimm/models/focalnet.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if int, all if none
HIGHtimm/models/pit.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if int, all if none
HIGHtimm/models/swin_transformer_v2_cr.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if int, all if none
HIGHtimm/models/efficientformer_v2.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if int, all if none
HIGHtimm/models/nextvit.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if int, all if none
HIGHtimm/models/hgnet.py0forward features that returns intermediates. args: x: input image tensor indices: take last n blocks if int, all if none
HIGHtimm/models/repvit.py0prune layers not required for specified intermediates.
183 more matches not shown…
Unused Imports773 hits · 533 pts
SeverityFileLineSnippet
LOWlegacy_train.py53
LOWtrain.py60
LOWinference.py9
LOWclean_checkpoint.py15
LOWtests/test_scheduler.py18
LOWtests/test_models.py30
LOWtimm/__init__.py1
LOWtimm/__init__.py2
LOWtimm/__init__.py2
LOWtimm/__init__.py2
LOWtimm/__init__.py2
LOWtimm/__init__.py8
LOWtimm/__init__.py8
LOWtimm/__init__.py8
LOWtimm/__init__.py8
LOWtimm/__init__.py8
LOWtimm/__init__.py8
LOWtimm/__init__.py8
LOWtimm/__init__.py8
LOWtimm/__init__.py8
LOWtimm/layers/squeeze_excite.py13
LOWtimm/layers/classifier.py11
LOWtimm/layers/create_act.py4
LOWtimm/layers/create_act.py4
LOWtimm/layers/create_act.py6
LOWtimm/layers/create_act.py7
LOWtimm/layers/create_norm.py9
LOWtimm/layers/separable_conv.py8
LOWtimm/layers/trace_utils.py2
LOWtimm/layers/__init__.py1
LOWtimm/layers/__init__.py1
LOWtimm/layers/__init__.py1
LOWtimm/layers/__init__.py1
LOWtimm/layers/__init__.py1
LOWtimm/layers/__init__.py1
LOWtimm/layers/__init__.py1
LOWtimm/layers/__init__.py1
LOWtimm/layers/__init__.py11
LOWtimm/layers/__init__.py12
LOWtimm/layers/__init__.py12
LOWtimm/layers/__init__.py12
LOWtimm/layers/__init__.py12
LOWtimm/layers/__init__.py18
LOWtimm/layers/__init__.py18
LOWtimm/layers/__init__.py18
LOWtimm/layers/__init__.py18
LOWtimm/layers/__init__.py19
LOWtimm/layers/__init__.py19
LOWtimm/layers/__init__.py19
LOWtimm/layers/__init__.py20
LOWtimm/layers/__init__.py20
LOWtimm/layers/__init__.py21
LOWtimm/layers/__init__.py21
LOWtimm/layers/__init__.py22
LOWtimm/layers/__init__.py22
LOWtimm/layers/__init__.py23
LOWtimm/layers/__init__.py23
LOWtimm/layers/__init__.py23
LOWtimm/layers/__init__.py23
LOWtimm/layers/__init__.py24
713 more matches not shown…
Hyper-Verbose Identifiers230 hits · 231 pts
SeverityFileLineSnippet
LOWtests/test_utils.py66def test_activation_stats_hook_validation():
LOWtests/test_utils.py99def test_freeze_unfreeze_bn_root():
LOWtests/test_utils.py116def test_activation_stats_functions():
LOWtests/test_utils.py135def test_reparameterize_model():
LOWtests/test_utils.py164def test_get_state_dict_custom_unwrap():
LOWtests/test_utils.py182def test_freeze_unfreeze_string_input():
LOWtests/test_task.py64def _param_group_weight_decay(optimizer):
LOWtests/test_task.py72def test_task_checkpoint_omits_empty_task_state_and_keeps_legacy_paths(tmp_path):
LOWtests/test_task.py103def test_feature_distillation_checkpoint_keeps_projection_in_task_state(tmp_path):
LOWtests/test_task.py141def test_feature_distillation_trainable_module_optimizer_grouping():
LOWtests/test_task.py167def test_base_eval_model_preserves_trainable_wrapper_for_use():
LOWtests/test_task.py177def test_compiled_ema_eval_model_reflects_update():
LOWtests/test_task.py202def test_compiled_eval_checkpoint_load_uses_unwrapped_state_dict_target():
LOWtests/test_layers.py81def test_get_act_layer_empty_string():
LOWtests/test_layers.py86def test_create_act_layer_inplace_error():
LOWtests/test_layers.py98def test_create_act_layer_edge_cases():
LOWtests/test_optim.py29def _test_basic_cases_template(weight, bias, input, constructor, scheduler_constructors):
LOWtests/test_optim.py289def _build_params_dict_single(weight, bias, **kwargs):
LOWtests/test_optim.py563def test_param_groups_layer_decay_with_min():
LOWtests/test_optim.py586def test_param_groups_layer_decay_with_matcher():
LOWtests/test_optim.py612def test_param_groups_weight_decay():
LOWtests/test_scheduler.py70 def test_plateau_scheduler_step(self):
LOWtests/test_scheduler.py122 def test_warmup_prefix_reaches_target_lr(self, scheduler_cls, kwargs):
LOWtests/test_scheduler.py347 def test_state_dict_save_load(self, scheduler_cls, kwargs):
LOWtests/test_scheduler.py368 def test_plateau_state_dict_save_load(self):
LOWtests/test_scheduler.py400 def test_step_update_with_t_in_epochs_false(self, scheduler_cls, kwargs):
LOWtests/test_scheduler.py430 def test_multiple_param_groups(self, scheduler_cls, kwargs):
LOWtests/test_models.py341def test_model_default_cfgs_non_std(model_name, batch_size):
LOWtests/test_models.py412 def test_model_load_pretrained(model_name, batch_size):
LOWtests/test_models.py421 def test_model_features_pretrained(model_name, batch_size):
LOWtests/test_models.py431def test_model_forward_torchscript(model_name, batch_size):
LOWtests/test_models.py461def test_model_forward_features(model_name, batch_size):
LOWtests/test_models.py492def test_model_forward_intermediates_features(model_name, batch_size):
LOWtests/test_models.py523def test_model_forward_intermediates(model_name, batch_size):
LOWtests/test_models.py712 def test_model_forward_fx_torchscript(model_name, batch_size):
LOWtests/test_models.py737 def test_model_forward_torchscript_with_features_fx(model_name, batch_size):
LOWtests/test_checkpoint_loading.py23def test_weights_only_allows_argparse_namespace(tmp_path):
LOWtests/test_checkpoint_loading.py36def test_weights_only_blocks_non_allowlisted_globals(tmp_path):
LOWtests/test_checkpoint_loading.py52def test_resume_checkpoint_default_weights_only_namespace(tmp_path):
LOWtests/test_checkpoint_loading.py82def test_resume_checkpoint_blocks_non_allowlisted_globals(tmp_path):
LOWtests/test_checkpoint_loading.py95def test_resume_checkpoint_weights_only_false_allows_custom_globals(tmp_path):
LOWtests/test_layers_drop.py125 def test_deprecated_args_accepted(self):
LOWtests/test_layers_drop.py156 def test_couple_channels_parameter(self):
LOWtests/test_layers_drop.py186 def test_no_drop_when_prob_zero(self):
LOWtests/test_layers_drop.py192 def test_no_drop_when_not_training(self):
LOWtests/test_layers_drop.py214 def test_drop_path_no_scaling(self):
LOWtests/test_layers_pool.py78 def test_attention_pool_latent_basic(self):
LOWtests/test_layers_pool.py85 def test_attention_pool_latent_multi_latent(self):
LOWtests/test_layers_pool.py231 def test_attention_pool_prr_basic(self):
LOWtests/test_layers_pool.py238 def test_attention_pool_prr_avg_pool(self):
LOWtests/test_layers_pool.py245 def test_attention_pool_prr_parameter_free(self):
LOWtests/test_layers_pool.py251 def test_attention_pool_prr_with_norms(self):
LOWtests/test_layers_pool.py274 def test_attention_pool_latent_out_features(self, out_features, embed_dim, expected_out):
LOWtests/test_layers_pool.py322 def test_lse_high_r_approximates_max(self):
LOWtests/test_layers_pool.py330 def test_lse_low_r_approximates_avg(self):
LOWtests/test_layers_pool.py338 def test_lse_learnable_r_gradient(self):
LOWtests/test_layers_pool.py460 def test_different_spatial_sizes(self, pool_cls, kwargs, input_shape):
LOWtimm/layers/pos_embed_sincos.py200 def init_non_persistent_buffers(self) -> None:
LOWtimm/layers/pos_embed_sincos.py496 def init_non_persistent_buffers(self) -> None:
LOWtimm/layers/pos_embed_sincos.py630 def init_non_persistent_buffers(self) -> None:
170 more matches not shown…
Deep Nesting149 hits · 149 pts
SeverityFileLineSnippet
LOWlegacy_train.py428
LOWlegacy_train.py1076
LOWlegacy_train.py1288
LOWbenchmark.py163
LOWbenchmark.py564
LOWbenchmark.py620
LOWbenchmark.py305
LOWvalidate.py175
LOWvalidate.py462
LOWvalidate.py491
LOWtrain.py460
LOWtrain.py1176
LOWtrain.py1392
LOWbulk_runner.py96
LOWbulk_runner.py141
LOWinference.py150
LOWinference.py353
LOWresults/generate_csv_results.py20
LOWtimm/layers/classifier.py282
LOWtimm/layers/pos_embed_sincos.py1235
LOWtimm/layers/gather_excite.py29
LOWtimm/layers/non_local_attn.py71
LOWtimm/layers/adaptive_avgmax_pool.py42
LOWtimm/layers/adaptive_avgmax_pool.py127
LOWtimm/layers/inplace_abn.py43
LOWtimm/layers/pool1d.py4
LOWtimm/layers/create_attn.py22
LOWtimm/layers/weight_init.py110
LOWtimm/layers/norm_act.py278
LOWtimm/layers/norm_act.py322
LOWtimm/scheduler/scheduler_factory.py63
LOWtimm/optim/_param_groups.py19
LOWtimm/optim/sgdw.py195
LOWtimm/optim/sgdw.py241
LOWtimm/optim/_optim_factory.py177
LOWtimm/optim/lamb.py153
LOWtimm/optim/adafactor.py128
LOWtimm/optim/adafactor_bv.py210
LOWtimm/optim/adafactor_bv.py123
LOWtimm/optim/lars.py76
LOWtimm/optim/nvnovograd.py67
LOWtimm/optim/adamp.py90
LOWtimm/optim/adabelief.py107
LOWtimm/optim/adamw.py103
LOWtimm/optim/kron.py400
LOWtimm/optim/kron.py218
LOWtimm/optim/radam.py38
LOWtimm/optim/laprop.py80
LOWtimm/optim/muon.py531
LOWtimm/optim/muon.py783
LOWtimm/optim/rmsprop_tf.py100
LOWtimm/optim/sgdp.py50
LOWtimm/optim/madgrad.py91
LOWtimm/utils/model.py111
LOWtimm/utils/model.py233
LOWtimm/utils/model.py237
LOWtimm/models/davit.py470
LOWtimm/models/inception_resnet_v2.py299
LOWtimm/models/inception_resnet_v2.py303
LOWtimm/models/hrnet.py439
89 more matches not shown…
Docstring Block Structure11 hits · 55 pts
SeverityFileLineSnippet
HIGHtimm/optim/_optim_factory.py161Get the OptimInfo for an optimizer. Args: name: Name of the optimizer Returns:
HIGHtimm/optim/_optim_factory.py182Get the optimizer class with any default arguments applied. This allows direct instantiation of optimizers with
HIGHtimm/optim/_optim_factory.py245Create an optimizer instance. Args: model_or_params: Model or parameters to optimize op
HIGHtimm/optim/_optim_factory.py1107List available optimizer names, optionally filtered. List all registered optimizers, with optional filtering using
HIGHtimm/optim/_optim_factory.py1148Get the OptimInfo for an optimizer. Args: name: Name of the optimizer Returns: OptimInfo confi
HIGHtimm/optim/_optim_factory.py1166Get optimizer class by name with option to bind default arguments. Retrieves the optimizer class or a partial funct
HIGHtimm/optim/_optim_factory.py1215Create an optimizer instance via timm registry. Creates and configures an optimizer with appropriate parameter grou
HIGHtimm/optim/muon.py267Check if a parameter is suitable for Muon optimization. Args: param: Parameter tensor min_dim_size:
HIGHtimm/models/_efficientnet_builder.py82 Decode block definition string Gets a list of block arg (dicts) through a string notation of arguments. E.g. i
HIGHtimm/data/auto_augment.py587 Create a AutoAugment transform Args: config_str: String defining configuration of auto augmentation. Consi
HIGHtimm/data/auto_augment.py767 Create a RandAugment transform Args: config_str (str): String defining configuration of random augmentatio
Decorative Section Separators15 hits · 45 pts
SeverityFileLineSnippet
MEDIUMtimm/optim/lion.py22# ==============================================================================
MEDIUMtimm/models/beit.py29# --------------------------------------------------------
MEDIUMtimm/models/twins.py8# --------------------------------------------------------
MEDIUMtimm/models/twins.py13# --------------------------------------------------------
MEDIUMtimm/models/swin_transformer_v2.py9# --------------------------------------------------------
MEDIUMtimm/models/swin_transformer_v2.py14# --------------------------------------------------------
MEDIUMtimm/models/swin_transformer.py12# --------------------------------------------------------
MEDIUMtimm/models/swin_transformer.py17# --------------------------------------------------------
MEDIUMtimm/models/focalnet.py14# --------------------------------------------------------
MEDIUMtimm/models/focalnet.py19# --------------------------------------------------------
MEDIUMtimm/models/hiera.py11# --------------------------------------------------------
MEDIUMtimm/models/hiera.py24# --------------------------------------------------------
MEDIUMtimm/models/swin_transformer_v2_cr.py24# --------------------------------------------------------
MEDIUMtimm/models/swin_transformer_v2_cr.py29# --------------------------------------------------------
MEDIUMtimm/data/tf_preprocessing.py23# ==============================================================================
Hallucination Indicators4 hits · 40 pts
SeverityFileLineSnippet
CRITICALtimm/models/hieradet_sam2.py426 self.head.fc.weight.data.mul_(head_init_scale)
CRITICALtimm/models/hieradet_sam2.py427 self.head.fc.bias.data.mul_(head_init_scale)
CRITICALtimm/models/hiera.py631 self.head.fc.weight.data.mul_(head_init_scale)
CRITICALtimm/models/hiera.py632 self.head.fc.bias.data.mul_(head_init_scale)
Over-Commented Block28 hits · 28 pts
SeverityFileLineSnippet
LOWtests/test_optim.py341 # _test_basic_cases(
LOWtimm/layers/pos_embed_rel.py41
LOWtimm/layers/patch_embed.py601#
LOWtimm/layers/patch_embed.py621# self.patch_size = to_2tuple(patch_size)
LOWtimm/layers/patch_embed.py641# else:
LOWtimm/layers/cond_conv2d.py121
LOWtimm/optim/lion.py1""" Lion Optimizer
LOWtimm/optim/lamb.py21# Copyright (c) 2021, Habana Labs Ltd. All rights reserved.
LOWtimm/optim/lamb.py41# Permission is hereby granted, free of charge, to any person obtaining a copy
LOWtimm/optim/adan.py1""" Adan Optimizer
LOWtimm/utils/distributed.py121 dist_backend = dist_backends.get(device_type, 'gloo')
LOWtimm/models/volo.py1""" Vision OutLOoker (VOLO) implementation
LOWtimm/models/efficientvit_mit.py1161 hf_hub_id='timm/',
LOWtimm/models/efficientvit_mit.py1261# def efficientvit_l0_sam(pretrained=False, **kwargs):
LOWtimm/models/beit.py21primaryClass={cs.CV}
LOWtimm/models/efficientvit_msra.py661
LOWtimm/models/efficientvit_msra.py681# for k, v in tmp_dict.items():
LOWtimm/models/shvit.py461
LOWtimm/models/shvit.py481 # downsample_mapping[f'^stages\\.{i}\\.blocks\\.{j}\\.'] = f'stages.{i}.blocks.{j - 3}.'
LOWtimm/models/fasternet.py401 # }
LOWtimm/models/twins.py101 x = x[:, :H, :W, :].contiguous()
LOWtimm/models/twins.py121 # x = x.reshape(B, _h, self.ws, _w, self.ws, C).transpose(2, 3) # B, _h, _w, ws, ws, C
LOWtimm/models/visformer.py521 attn_stage='011', spatial_conv='100', norm_layer=nn.BatchNorm2d, conv_init=True,
LOWtimm/models/visformer.py541# model.default_cfg = _cfg()
LOWtimm/models/visformer.py561#
LOWtimm/models/visformer.py581# @register_model
LOWtimm/models/hiera.py1""" An PyTorch implementation of Hiera
LOWtimm/data/tf_preprocessing.py1""" Tensorflow Preprocessing Adapter
Excessive Try-Catch Wrapping23 hits · 28 pts
SeverityFileLineSnippet
MEDIUMavg_checkpoints.py85 print("Error: Output filename ({}) already exists.".format(output))
MEDIUMavg_checkpoints.py113 print('Error: No checkpoints found to average.')
MEDIUMavg_checkpoints.py121 print(f"Error: Checkpoint ({c}) doesn't exist")
LOWbulk_runner.py203 except Exception as e:
MEDIUMclean_checkpoint.py42 print("Error: Output filename ({}) already exists.".format(args.output))
MEDIUMclean_checkpoint.py110 print("Error: Checkpoint ({}) doesn't exist".format(checkpoint))
LOWtests/test_models.py199 except Exception:
LOWtests/test_models.py560 except Exception:
LOWtimm/layers/blur_pool.py118 except Exception:
LOWtimm/optim/lion.py159 except Exception:
LOWtimm/optim/adan.py127 except Exception:
MEDIUMtimm/optim/adan.py34def __init__(self, chunk_size):
LOWtimm/optim/adamw.py216 except Exception:
LOWtimm/optim/nadamw.py196 except Exception:
LOWtimm/utils/jit.py33 except Exception:
LOWtimm/utils/jit.py42 except Exception:
LOWtimm/utils/checkpoint_saver.py122 except Exception as e:
LOWtimm/utils/checkpoint_saver.py178 except Exception as e:
LOWtimm/models/eva.py1228 except Exception as e:
LOWtimm/models/_hub.py572 except Exception as _:
LOWtimm/models/_helpers.py36 except Exception:
LOWtimm/data/naflex_dataset.py549 except Exception as e:
LOWtimm/data/readers/reader_wds.py57 except Exception as e:
Redundant / Tautological Comments16 hits · 24 pts
SeverityFileLineSnippet
LOWlegacy_train.py689 # Check if we should use the NaFlex scheduled loader
LOWlegacy_train.py753 # Check if we have model's patch size for NaFlex mode
LOWtrain.py671 # Check if we should use the NaFlex scheduled loader
LOWtrain.py735 # Check if we have model's patch size for NaFlex mode
LOWtimm/layers/pos_embed_sincos.py682 # Check if we have pre-computed bands
LOWtimm/layers/blur_pool.py143 # Check if aa_layer is a partial and already has device/dtype set
LOWtimm/optim/muon.py576 # Increment step
LOWtimm/models/vision_transformer.py3072 # Check if we should use NaFlexVit instead
LOWtimm/models/fastvit.py96 # Check if SE-ReLU is requested
LOWtimm/models/naflexvit.py281 # Check if we need EVA block features
LOWtimm/models/naflexvit.py1937 # Check if it's a perfect square for a standard grid
LOWtimm/models/eva.py1297 # Check if we should use NaFlexVit implementation
LOWtimm/models/_hub.py419 # Check if README file already exist in repo
LOWtimm/models/_helpers.py111 # Check if safetensors or not and load weights accordingly
LOWtimm/data/naflex_dataset.py119 # Check if patches are flattened or unflattened
LOWconvert/convert_gemma4_vit.py97 # Check if this is a vision key (vision_tower or vision_model)
Self-Referential Comments10 hits · 21 pts
SeverityFileLineSnippet
MEDIUMtimm/models/_factory.py85 >>> # Create a MobileNetV3-Large model with no pretrained weights.
MEDIUMtimm/models/_factory.py88 >>> # Create a MobileNetV3-Large model with pretrained weights.
MEDIUMtimm/models/_factory.py93 >>> # Create a MobileNetV3-Large model with pretrained weights and a new head with 10 classes.
MEDIUMtimm/models/_factory.py98 >>> # Create a Dinov2 small model with pretrained weights and save weights in a custom directory.
MEDIUMtimm/models/naflexvit.py1024 # Create the float mask and apply masking using additive mask convention
MEDIUMtimm/models/hiera.py154 # Create a view of the tensor with the patch stride as separate dims
MEDIUMtimm/models/swin_transformer_v2_cr.py98 r"""This class implements window-based Multi-Head-Attention with log-spaced continuous position bias.
MEDIUMtimm/models/swin_transformer_v2_cr.py246 r"""This class implements the Swin transformer block.
MEDIUMtimm/models/swin_transformer_v2_cr.py594 r"""This class implements a stage of the Swin transformer including multiple layers.
MEDIUMtimm/data/naflex_loader.py422 # Create the collator
AI Slop Vocabulary5 hits · 10 pts
SeverityFileLineSnippet
MEDIUMtimm/layers/norm_act.py156 # but ONLY when used in conjunction with the timm conversion function below.
MEDIUMtimm/models/gemma4_vit.py1364 # so the test harness' size-clamp doesn't land at 128 and blow the
MEDIUMtimm/models/swin_transformer_v2_cr.py681 """ Updates the resolution to utilize and the window size and so the pair-wise relative positions.
MEDIUMtimm/data/imagenet_info.py41 # which will be more robust than a guess based on num_classes
LOWtimm/data/naflex_dataset.py61 # If no divisor specified, just use integer division
Slop Phrases1 hit · 2 pts
SeverityFileLineSnippet
LOWtimm/models/xception.py286 # The resize parameter of the validation transform should be 333, and make sure to center crop at 299x299
Verbosity Indicators1 hit · 2 pts
SeverityFileLineSnippet
LOWtimm/data/naflex_transforms.py261 # Step 1: Get the maximum allowed dimensions from sequence length constraint