Skip to content

Commit b6be046

Browse files
committed
Updating remaining licenses
1 parent 60f2837 commit b6be046

File tree

11 files changed

+38
-29
lines changed

11 files changed

+38
-29
lines changed

timm/models/_hub.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -585,4 +585,11 @@ def _get_license_from_hf_hub(model_id: str | None, hf_hub_id: str | None) -> str
585585
return None
586586

587587
license = info.card_data.get("license").lower() if info.card_data else None
588+
589+
if license == 'other':
590+
name = info.card_data.get("license_name", None)
591+
592+
if name is not None:
593+
return name
594+
588595
return license

timm/models/byobnet.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2453,31 +2453,31 @@ def _cfgr(url: str = '', **kwargs) -> Dict[str, Any]:
24532453
hf_hub_id='timm/',
24542454
crop_pct=0.875,
24552455
first_conv=('stem.conv_kxk.0.conv', 'stem.conv_scale.conv'),
2456-
license='other',
2456+
license='mobileone-license',
24572457
),
24582458
'mobileone_s1.apple_in1k': _cfg(
24592459
hf_hub_id='timm/',
24602460
crop_pct=0.9,
24612461
first_conv=('stem.conv_kxk.0.conv', 'stem.conv_scale.conv'),
2462-
license='other',
2462+
license='mobileone-license',
24632463
),
24642464
'mobileone_s2.apple_in1k': _cfg(
24652465
hf_hub_id='timm/',
24662466
crop_pct=0.9,
24672467
first_conv=('stem.conv_kxk.0.conv', 'stem.conv_scale.conv'),
2468-
license='other',
2468+
license='mobileone-license',
24692469
),
24702470
'mobileone_s3.apple_in1k': _cfg(
24712471
hf_hub_id='timm/',
24722472
crop_pct=0.9,
24732473
first_conv=('stem.conv_kxk.0.conv', 'stem.conv_scale.conv'),
2474-
license='other',
2474+
license='mobileone-license',
24752475
),
24762476
'mobileone_s4.apple_in1k': _cfg(
24772477
hf_hub_id='timm/',
24782478
crop_pct=0.9,
24792479
first_conv=('stem.conv_kxk.0.conv', 'stem.conv_scale.conv'),
2480-
license='other',
2480+
license='mobileone-license',
24812481
),
24822482

24832483
# original attention pool head variants

timm/models/convnext.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,25 +1067,25 @@ def _cfgv2(url='', **kwargs):
10671067
hf_hub_id='timm/',
10681068
crop_pct=1.0,
10691069
num_classes=0,
1070-
license='dinov3',
1070+
license='dinov3-license',
10711071
),
10721072
'convnext_small.dinov3_lvd1689m': _cfg(
10731073
hf_hub_id='timm/',
10741074
crop_pct=1.0,
10751075
num_classes=0,
1076-
license='dinov3',
1076+
license='dinov3-license',
10771077
),
10781078
'convnext_base.dinov3_lvd1689m': _cfg(
10791079
hf_hub_id='timm/',
10801080
crop_pct=1.0,
10811081
num_classes=0,
1082-
license='dinov3',
1082+
license='dinov3-license',
10831083
),
10841084
'convnext_large.dinov3_lvd1689m': _cfg(
10851085
hf_hub_id='timm/',
10861086
crop_pct=1.0,
10871087
num_classes=0,
1088-
license='dinov3',
1088+
license='dinov3-license',
10891089
),
10901090

10911091
"test_convnext.r160_in1k": _cfg(

timm/models/eva.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1276,7 +1276,7 @@ def _dinov3_cfg(url: str = '', **kwargs) -> Dict[str, Any]:
12761276
'crop_pct': 1.0, 'interpolation': 'bicubic', 'min_input_size': (3, 128, 128),
12771277
'mean': IMAGENET_DEFAULT_MEAN, 'std': IMAGENET_DEFAULT_STD,
12781278
'first_conv': 'patch_embed.proj', 'classifier': 'head',
1279-
'license': 'dinov3', **kwargs
1279+
'license': 'dinov3-license', **kwargs
12801280
}
12811281

12821282
default_cfgs = generate_default_cfgs({
@@ -2538,7 +2538,7 @@ def vit_large_patch16_rope_ape_224(pretrained: bool = False, **kwargs) -> Eva:
25382538
rope_grid_indexing='xy',
25392539
rope_temperature=100.0,
25402540
)
2541-
2541+
25422542
model = _create_eva('vit_large_patch16_rope_ape_224', pretrained=pretrained, **dict(model_args, **kwargs))
25432543
return model
25442544

timm/models/fastvit.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1363,7 +1363,7 @@ def _cfg(url="", **kwargs):
13631363
"license": "other",
13641364
"std": IMAGENET_DEFAULT_STD,
13651365
'first_conv': ('stem.0.conv_kxk.0.conv', 'stem.0.conv_scale.conv'),
1366-
"classifier": "head.fc",
1366+
"classifier": "head.fc", "license": "fastvit-license",
13671367
**kwargs,
13681368
}
13691369

@@ -1411,21 +1411,21 @@ def _cfg(url="", **kwargs):
14111411
url='https://docs-assets.developer.apple.com/ml-research/datasets/mobileclip/mobileclip_s0.pt',
14121412
crop_pct=0.95,
14131413
num_classes=512, # CLIP proj dim
1414-
mean=(0., 0., 0.), std=(1., 1., 1.), license=None,
1414+
mean=(0., 0., 0.), std=(1., 1., 1.), license='apple-amlr'
14151415
),
14161416
"fastvit_mci1.apple_mclip": _cfg(
14171417
hf_hub_id='apple/mobileclip_s1_timm',
14181418
url='https://docs-assets.developer.apple.com/ml-research/datasets/mobileclip/mobileclip_s1.pt',
14191419
crop_pct=0.95,
14201420
num_classes=512, # CLIP proj dim
1421-
mean=(0., 0., 0.), std=(1., 1., 1.), license=None,
1421+
mean=(0., 0., 0.), std=(1., 1., 1.), license='apple-amlr'
14221422
),
14231423
"fastvit_mci2.apple_mclip": _cfg(
14241424
hf_hub_id='apple/mobileclip_s2_timm',
14251425
url='https://docs-assets.developer.apple.com/ml-research/datasets/mobileclip/mobileclip_s2.pt',
14261426
crop_pct=0.95,
14271427
num_classes=512, # CLIP proj dim
1428-
mean=(0., 0., 0.), std=(1., 1., 1.), license=None,
1428+
mean=(0., 0., 0.), std=(1., 1., 1.), license='apple-amlr'
14291429
),
14301430

14311431
"fastvit_mci0.apple_mclip2_dfndr2b": _cfg(

timm/models/mobilevit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ def _cfg(url='', **kwargs):
567567
'mean': (0., 0., 0.), 'std': (1., 1., 1.),
568568
'first_conv': 'stem.conv', 'classifier': 'head.fc',
569569
'fixed_input_size': False,
570-
'license': 'other',
570+
'license': 'cvnets-license',
571571
**kwargs
572572
}
573573

timm/models/regnet.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1173,37 +1173,37 @@ def _cfgtv2(url: str = '', **kwargs) -> Dict[str, Any]:
11731173

11741174
'regnety_320.seer_ft_in1k': _cfgtv2(
11751175
hf_hub_id='timm/',
1176-
license='other', origin_url='https://github.com/facebookresearch/vissl',
1176+
license='seer-license', origin_url='https://github.com/facebookresearch/vissl',
11771177
url='https://dl.fbaipublicfiles.com/vissl/model_zoo/seer_finetuned/seer_regnet32_finetuned_in1k_model_final_checkpoint_phase78.torch',
11781178
input_size=(3, 384, 384), pool_size=(12, 12), crop_pct=1.0),
11791179
'regnety_640.seer_ft_in1k': _cfgtv2(
11801180
hf_hub_id='timm/',
1181-
license='other', origin_url='https://github.com/facebookresearch/vissl',
1181+
license='seer-license', origin_url='https://github.com/facebookresearch/vissl',
11821182
url='https://dl.fbaipublicfiles.com/vissl/model_zoo/seer_finetuned/seer_regnet64_finetuned_in1k_model_final_checkpoint_phase78.torch',
11831183
input_size=(3, 384, 384), pool_size=(12, 12), crop_pct=1.0),
11841184
'regnety_1280.seer_ft_in1k': _cfgtv2(
11851185
hf_hub_id='timm/',
1186-
license='other', origin_url='https://github.com/facebookresearch/vissl',
1186+
license='seer-license', origin_url='https://github.com/facebookresearch/vissl',
11871187
url='https://dl.fbaipublicfiles.com/vissl/model_zoo/seer_finetuned/seer_regnet128_finetuned_in1k_model_final_checkpoint_phase78.torch',
11881188
input_size=(3, 384, 384), pool_size=(12, 12), crop_pct=1.0),
11891189
'regnety_2560.seer_ft_in1k': _cfgtv2(
11901190
hf_hub_id='timm/',
1191-
license='other', origin_url='https://github.com/facebookresearch/vissl',
1191+
license='seer-license', origin_url='https://github.com/facebookresearch/vissl',
11921192
url='https://dl.fbaipublicfiles.com/vissl/model_zoo/seer_finetuned/seer_regnet256_finetuned_in1k_model_final_checkpoint_phase38.torch',
11931193
input_size=(3, 384, 384), pool_size=(12, 12), crop_pct=1.0),
11941194

11951195
'regnety_320.seer': _cfgtv2(
11961196
hf_hub_id='timm/',
11971197
url='https://dl.fbaipublicfiles.com/vissl/model_zoo/seer_regnet32d/seer_regnet32gf_model_iteration244000.torch',
1198-
num_classes=0, license='other', origin_url='https://github.com/facebookresearch/vissl'),
1198+
num_classes=0, license='seer-license', origin_url='https://github.com/facebookresearch/vissl'),
11991199
'regnety_640.seer': _cfgtv2(
12001200
hf_hub_id='timm/',
12011201
url='https://dl.fbaipublicfiles.com/vissl/model_zoo/seer_regnet64/seer_regnet64gf_model_final_checkpoint_phase0.torch',
1202-
num_classes=0, license='other', origin_url='https://github.com/facebookresearch/vissl'),
1202+
num_classes=0, license='seer-license', origin_url='https://github.com/facebookresearch/vissl'),
12031203
'regnety_1280.seer': _cfgtv2(
12041204
hf_hub_id='timm/',
12051205
url='https://dl.fbaipublicfiles.com/vissl/model_zoo/swav_ig1b_regnet128Gf_cnstant_bs32_node16_sinkhorn10_proto16k_syncBN64_warmup8k/model_final_checkpoint_phase0.torch',
1206-
num_classes=0, license='other', origin_url='https://github.com/facebookresearch/vissl'),
1206+
num_classes=0, license='seer-license', origin_url='https://github.com/facebookresearch/vissl'),
12071207
# FIXME invalid weight <-> model match, mistake on their end
12081208
#'regnety_2560.seer': _cfgtv2(
12091209
# url='https://dl.fbaipublicfiles.com/vissl/model_zoo/swav_ig1b_cosine_rg256gf_noBNhead_wd1e5_fairstore_bs16_node64_sinkhorn10_proto16k_apex_syncBN64_warmup8k/model_final_checkpoint_phase0.torch',
@@ -1464,4 +1464,4 @@ def regnetz_040_h(pretrained: bool = False, **kwargs) -> RegNet:
14641464

14651465
register_model_deprecations(__name__, {
14661466
'regnetz_040h': 'regnetz_040_h',
1467-
})
1467+
})

timm/models/senet.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ def _cfg(url='', **kwargs):
372372
'url': url, 'num_classes': 1000, 'input_size': (3, 224, 224), 'pool_size': (7, 7),
373373
'crop_pct': 0.875, 'interpolation': 'bilinear',
374374
'mean': IMAGENET_DEFAULT_MEAN, 'std': IMAGENET_DEFAULT_STD,
375-
'first_conv': 'layer0.conv1', 'classifier': 'last_linear',
375+
'first_conv': 'layer0.conv1', 'classifier': 'last_linear', 'license': 'apache-2.0',
376376
**kwargs
377377
}
378378

timm/models/vision_transformer_hybrid.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,14 +222,15 @@ def _cfg(url='', **kwargs):
222222
'vit_base_mci_224.apple_mclip_lt': _cfg(
223223
hf_hub_id='apple/mobileclip_b_lt_timm',
224224
url='https://docs-assets.developer.apple.com/ml-research/datasets/mobileclip/mobileclip_blt.pt',
225-
license=None,
225+
license='apple-amlr',
226226
num_classes=512,
227227
mean=(0., 0., 0.), std=(1., 1., 1.), first_conv='patch_embed.backbone.0.conv',
228228
),
229229
'vit_base_mci_224.apple_mclip': _cfg(
230230
hf_hub_id='apple/mobileclip_b_timm',
231231
url='https://docs-assets.developer.apple.com/ml-research/datasets/mobileclip/mobileclip_b.pt',
232232
num_classes=512,
233+
license='apple-amlr',
233234
mean=(0., 0., 0.), std=(1., 1., 1.), first_conv='patch_embed.backbone.0.conv',
234235
),
235236
'vit_base_mci_224.apple_mclip2_dfndr2b': _cfg(

timm/models/vitamin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ def _cfg(url='', **kwargs):
303303
'crop_pct': .9, 'interpolation': 'bicubic', 'fixed_input_size': True,
304304
'mean': OPENAI_CLIP_MEAN, 'std': OPENAI_CLIP_STD,
305305
'first_conv': 'patch_embed.backbone.stem.conv1',
306-
'classifier': 'head',
306+
'classifier': 'head', 'license': 'mit',
307307
**kwargs
308308
}
309309

@@ -601,4 +601,4 @@ def vitamin_xlarge_384(pretrained=False, **kwargs) -> VisionTransformer:
601601
img_size=384, embed_dim=1152, depth=32, num_heads=16, mlp_layer=GeGluMlp, mlp_ratio=2.,
602602
class_token=False, global_pool='avg', pos_embed='none', embed_cfg=embed_cfg)
603603
model = _create_vitamin('vitamin_xlarge_384', pretrained=pretrained, **dict(model_args, **kwargs))
604-
return model
604+
return model

0 commit comments

Comments
 (0)