Skip to content

Commit c08ae1e

Browse files
committed
Updating remaining licenses
1 parent e6225c8 commit c08ae1e

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
@@ -578,4 +578,11 @@ def _get_license_from_hf_hub(model_id: str | None, hf_hub_id: str | None) -> str
578578
return None
579579

580580
license = info.card_data.get("license").lower() if info.card_data else None
581+
582+
if license == 'other':
583+
name = info.card_data.get("license_name", None)
584+
585+
if name is not None:
586+
return name
587+
581588
return license

timm/models/byobnet.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2606,31 +2606,31 @@ def _cfgr(url: str = '', **kwargs) -> Dict[str, Any]:
26062606
hf_hub_id='timm/',
26072607
crop_pct=0.875,
26082608
first_conv=('stem.conv_kxk.0.conv', 'stem.conv_scale.conv'),
2609-
license='other',
2609+
license='mobileone-license',
26102610
),
26112611
'mobileone_s1.apple_in1k': _cfg(
26122612
hf_hub_id='timm/',
26132613
crop_pct=0.9,
26142614
first_conv=('stem.conv_kxk.0.conv', 'stem.conv_scale.conv'),
2615-
license='other',
2615+
license='mobileone-license',
26162616
),
26172617
'mobileone_s2.apple_in1k': _cfg(
26182618
hf_hub_id='timm/',
26192619
crop_pct=0.9,
26202620
first_conv=('stem.conv_kxk.0.conv', 'stem.conv_scale.conv'),
2621-
license='other',
2621+
license='mobileone-license',
26222622
),
26232623
'mobileone_s3.apple_in1k': _cfg(
26242624
hf_hub_id='timm/',
26252625
crop_pct=0.9,
26262626
first_conv=('stem.conv_kxk.0.conv', 'stem.conv_scale.conv'),
2627-
license='other',
2627+
license='mobileone-license',
26282628
),
26292629
'mobileone_s4.apple_in1k': _cfg(
26302630
hf_hub_id='timm/',
26312631
crop_pct=0.9,
26322632
first_conv=('stem.conv_kxk.0.conv', 'stem.conv_scale.conv'),
2633-
license='other',
2633+
license='mobileone-license',
26342634
),
26352635

26362636
# original attention pool head variants

timm/models/convnext.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,25 +1113,25 @@ def _cfgv2(url='', **kwargs):
11131113
hf_hub_id='timm/',
11141114
crop_pct=1.0,
11151115
num_classes=0,
1116-
license='dinov3',
1116+
license='dinov3-license',
11171117
),
11181118
'convnext_small.dinov3_lvd1689m': _cfg(
11191119
hf_hub_id='timm/',
11201120
crop_pct=1.0,
11211121
num_classes=0,
1122-
license='dinov3',
1122+
license='dinov3-license',
11231123
),
11241124
'convnext_base.dinov3_lvd1689m': _cfg(
11251125
hf_hub_id='timm/',
11261126
crop_pct=1.0,
11271127
num_classes=0,
1128-
license='dinov3',
1128+
license='dinov3-license',
11291129
),
11301130
'convnext_large.dinov3_lvd1689m': _cfg(
11311131
hf_hub_id='timm/',
11321132
crop_pct=1.0,
11331133
num_classes=0,
1134-
license='dinov3',
1134+
license='dinov3-license',
11351135
),
11361136

11371137
"test_convnext.r160_in1k": _cfg(

timm/models/eva.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1305,7 +1305,7 @@ def _dinov3_cfg(url: str = '', **kwargs) -> Dict[str, Any]:
13051305
'crop_pct': 1.0, 'interpolation': 'bicubic', 'fixed_input_size': True,
13061306
'mean': IMAGENET_DEFAULT_MEAN, 'std': IMAGENET_DEFAULT_STD,
13071307
'first_conv': 'patch_embed.proj', 'classifier': 'head',
1308-
'license': 'dinov3', **kwargs
1308+
'license': 'dinov3-license', **kwargs
13091309
}
13101310

13111311
default_cfgs = generate_default_cfgs({
@@ -2567,7 +2567,7 @@ def vit_large_patch16_rope_ape_224(pretrained: bool = False, **kwargs) -> Eva:
25672567
rope_grid_indexing='xy',
25682568
rope_temperature=100.0,
25692569
)
2570-
2570+
25712571
model = _create_eva('vit_large_patch16_rope_ape_224', pretrained=pretrained, **dict(model_args, **kwargs))
25722572
return model
25732573

timm/models/fastvit.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1434,7 +1434,7 @@ def _cfg(url="", **kwargs):
14341434
"license": "other",
14351435
"std": IMAGENET_DEFAULT_STD,
14361436
'first_conv': ('stem.0.conv_kxk.0.conv', 'stem.0.conv_scale.conv'),
1437-
"classifier": "head.fc",
1437+
"classifier": "head.fc", "license": "fastvit-license",
14381438
**kwargs,
14391439
}
14401440

@@ -1482,21 +1482,21 @@ def _cfg(url="", **kwargs):
14821482
url='https://docs-assets.developer.apple.com/ml-research/datasets/mobileclip/mobileclip_s0.pt',
14831483
crop_pct=0.95,
14841484
num_classes=512, # CLIP proj dim
1485-
mean=(0., 0., 0.), std=(1., 1., 1.), license=None,
1485+
mean=(0., 0., 0.), std=(1., 1., 1.), license='apple-amlr'
14861486
),
14871487
"fastvit_mci1.apple_mclip": _cfg(
14881488
hf_hub_id='apple/mobileclip_s1_timm',
14891489
url='https://docs-assets.developer.apple.com/ml-research/datasets/mobileclip/mobileclip_s1.pt',
14901490
crop_pct=0.95,
14911491
num_classes=512, # CLIP proj dim
1492-
mean=(0., 0., 0.), std=(1., 1., 1.), license=None,
1492+
mean=(0., 0., 0.), std=(1., 1., 1.), license='apple-amlr'
14931493
),
14941494
"fastvit_mci2.apple_mclip": _cfg(
14951495
hf_hub_id='apple/mobileclip_s2_timm',
14961496
url='https://docs-assets.developer.apple.com/ml-research/datasets/mobileclip/mobileclip_s2.pt',
14971497
crop_pct=0.95,
14981498
num_classes=512, # CLIP proj dim
1499-
mean=(0., 0., 0.), std=(1., 1., 1.), license=None,
1499+
mean=(0., 0., 0.), std=(1., 1., 1.), license='apple-amlr'
15001500
),
15011501

15021502
"fastvit_mci0.apple_mclip2_dfndr2b": _cfg(

timm/models/mobilevit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ def _cfg(url='', **kwargs):
595595
'mean': (0., 0., 0.), 'std': (1., 1., 1.),
596596
'first_conv': 'stem.conv', 'classifier': 'head.fc',
597597
'fixed_input_size': False,
598-
'license': 'other',
598+
'license': 'cvnets-license',
599599
**kwargs
600600
}
601601

timm/models/regnet.py

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

11961196
'regnety_320.seer_ft_in1k': _cfgtv2(
11971197
hf_hub_id='timm/',
1198-
license='other', origin_url='https://github.com/facebookresearch/vissl',
1198+
license='seer-license', origin_url='https://github.com/facebookresearch/vissl',
11991199
url='https://dl.fbaipublicfiles.com/vissl/model_zoo/seer_finetuned/seer_regnet32_finetuned_in1k_model_final_checkpoint_phase78.torch',
12001200
input_size=(3, 384, 384), pool_size=(12, 12), crop_pct=1.0),
12011201
'regnety_640.seer_ft_in1k': _cfgtv2(
12021202
hf_hub_id='timm/',
1203-
license='other', origin_url='https://github.com/facebookresearch/vissl',
1203+
license='seer-license', origin_url='https://github.com/facebookresearch/vissl',
12041204
url='https://dl.fbaipublicfiles.com/vissl/model_zoo/seer_finetuned/seer_regnet64_finetuned_in1k_model_final_checkpoint_phase78.torch',
12051205
input_size=(3, 384, 384), pool_size=(12, 12), crop_pct=1.0),
12061206
'regnety_1280.seer_ft_in1k': _cfgtv2(
12071207
hf_hub_id='timm/',
1208-
license='other', origin_url='https://github.com/facebookresearch/vissl',
1208+
license='seer-license', origin_url='https://github.com/facebookresearch/vissl',
12091209
url='https://dl.fbaipublicfiles.com/vissl/model_zoo/seer_finetuned/seer_regnet128_finetuned_in1k_model_final_checkpoint_phase78.torch',
12101210
input_size=(3, 384, 384), pool_size=(12, 12), crop_pct=1.0),
12111211
'regnety_2560.seer_ft_in1k': _cfgtv2(
12121212
hf_hub_id='timm/',
1213-
license='other', origin_url='https://github.com/facebookresearch/vissl',
1213+
license='seer-license', origin_url='https://github.com/facebookresearch/vissl',
12141214
url='https://dl.fbaipublicfiles.com/vissl/model_zoo/seer_finetuned/seer_regnet256_finetuned_in1k_model_final_checkpoint_phase38.torch',
12151215
input_size=(3, 384, 384), pool_size=(12, 12), crop_pct=1.0),
12161216

12171217
'regnety_320.seer': _cfgtv2(
12181218
hf_hub_id='timm/',
12191219
url='https://dl.fbaipublicfiles.com/vissl/model_zoo/seer_regnet32d/seer_regnet32gf_model_iteration244000.torch',
1220-
num_classes=0, license='other', origin_url='https://github.com/facebookresearch/vissl'),
1220+
num_classes=0, license='seer-license', origin_url='https://github.com/facebookresearch/vissl'),
12211221
'regnety_640.seer': _cfgtv2(
12221222
hf_hub_id='timm/',
12231223
url='https://dl.fbaipublicfiles.com/vissl/model_zoo/seer_regnet64/seer_regnet64gf_model_final_checkpoint_phase0.torch',
1224-
num_classes=0, license='other', origin_url='https://github.com/facebookresearch/vissl'),
1224+
num_classes=0, license='seer-license', origin_url='https://github.com/facebookresearch/vissl'),
12251225
'regnety_1280.seer': _cfgtv2(
12261226
hf_hub_id='timm/',
12271227
url='https://dl.fbaipublicfiles.com/vissl/model_zoo/swav_ig1b_regnet128Gf_cnstant_bs32_node16_sinkhorn10_proto16k_syncBN64_warmup8k/model_final_checkpoint_phase0.torch',
1228-
num_classes=0, license='other', origin_url='https://github.com/facebookresearch/vissl'),
1228+
num_classes=0, license='seer-license', origin_url='https://github.com/facebookresearch/vissl'),
12291229
# FIXME invalid weight <-> model match, mistake on their end
12301230
#'regnety_2560.seer': _cfgtv2(
12311231
# 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',
@@ -1486,4 +1486,4 @@ def regnetz_040_h(pretrained: bool = False, **kwargs) -> RegNet:
14861486

14871487
register_model_deprecations(__name__, {
14881488
'regnetz_040h': 'regnetz_040_h',
1489-
})
1489+
})

timm/models/senet.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ def _cfg(url='', **kwargs):
448448
'url': url, 'num_classes': 1000, 'input_size': (3, 224, 224), 'pool_size': (7, 7),
449449
'crop_pct': 0.875, 'interpolation': 'bilinear',
450450
'mean': IMAGENET_DEFAULT_MEAN, 'std': IMAGENET_DEFAULT_STD,
451-
'first_conv': 'layer0.conv1', 'classifier': 'last_linear',
451+
'first_conv': 'layer0.conv1', 'classifier': 'last_linear', 'license': 'apache-2.0',
452452
**kwargs
453453
}
454454

timm/models/vision_transformer_hybrid.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,14 +242,15 @@ def _cfg(url='', **kwargs):
242242
'vit_base_mci_224.apple_mclip_lt': _cfg(
243243
hf_hub_id='apple/mobileclip_b_lt_timm',
244244
url='https://docs-assets.developer.apple.com/ml-research/datasets/mobileclip/mobileclip_blt.pt',
245-
license=None,
245+
license='apple-amlr',
246246
num_classes=512,
247247
mean=(0., 0., 0.), std=(1., 1., 1.), first_conv='patch_embed.backbone.0.conv',
248248
),
249249
'vit_base_mci_224.apple_mclip': _cfg(
250250
hf_hub_id='apple/mobileclip_b_timm',
251251
url='https://docs-assets.developer.apple.com/ml-research/datasets/mobileclip/mobileclip_b.pt',
252252
num_classes=512,
253+
license='apple-amlr',
253254
mean=(0., 0., 0.), std=(1., 1., 1.), first_conv='patch_embed.backbone.0.conv',
254255
),
255256
'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
@@ -325,7 +325,7 @@ def _cfg(url='', **kwargs):
325325
'crop_pct': .9, 'interpolation': 'bicubic', 'fixed_input_size': True,
326326
'mean': OPENAI_CLIP_MEAN, 'std': OPENAI_CLIP_STD,
327327
'first_conv': 'patch_embed.backbone.stem.conv1',
328-
'classifier': 'head',
328+
'classifier': 'head', 'license': 'mit',
329329
**kwargs
330330
}
331331

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

0 commit comments

Comments
 (0)