Skip to content

Commit 60f2837

Browse files
committed
Updating licenses
1 parent 24b67f8 commit 60f2837

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+133
-37
lines changed

timm/models/_hub.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -575,8 +575,13 @@ def _get_license_from_hf_hub(model_id: str | None, hf_hub_id: str | None) -> str
575575
info = model_info(repo_id=repo_id)
576576

577577
except RepositoryNotFoundError:
578-
# TODO: any wish what happens here? @rwightman
579-
print(repo_id)
578+
msg = f"Repository {repo_id} was not found. Manual inspection of license needed."
579+
_logger.warning(msg=msg)
580+
return None
581+
582+
except Exception as _:
583+
msg = f"Error for {repo_id}. Manual inspection of license needed."
584+
_logger.warning(msg=msg)
580585
return None
581586

582587
license = info.card_data.get("license").lower() if info.card_data else None

timm/models/beit.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,7 @@ def _cfg(url: str = '', **kwargs) -> Dict[str, Any]:
738738
'crop_pct': .9, 'interpolation': 'bicubic', 'fixed_input_size': True,
739739
'mean': (0.5, 0.5, 0.5), 'std': (0.5, 0.5, 0.5),
740740
'first_conv': 'patch_embed.proj', 'classifier': 'head',
741+
'license': 'apache-2.0',
741742
**kwargs
742743
}
743744

timm/models/byoanet.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ def _cfg(url: str = '', **kwargs) -> Dict[str, Any]:
297297
'crop_pct': 0.95, 'interpolation': 'bicubic',
298298
'mean': IMAGENET_DEFAULT_MEAN, 'std': IMAGENET_DEFAULT_STD,
299299
'first_conv': 'stem.conv1.conv', 'classifier': 'head.fc',
300-
'fixed_input_size': False, 'min_input_size': (3, 224, 224),
300+
'fixed_input_size': False, 'min_input_size': (3, 224, 224), 'license': 'apache-2.0',
301301
**kwargs
302302
}
303303

timm/models/byobnet.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2279,6 +2279,7 @@ def _cfg(url: str = '', **kwargs) -> Dict[str, Any]:
22792279
'crop_pct': 0.875, 'interpolation': 'bilinear',
22802280
'mean': IMAGENET_DEFAULT_MEAN, 'std': IMAGENET_DEFAULT_STD,
22812281
'first_conv': 'stem.conv', 'classifier': 'head.fc',
2282+
'license': 'apache-2.0',
22822283
**kwargs
22832284
}
22842285

@@ -2298,6 +2299,7 @@ def _cfgr(url: str = '', **kwargs) -> Dict[str, Any]:
22982299
'crop_pct': 0.9, 'interpolation': 'bicubic',
22992300
'mean': IMAGENET_DEFAULT_MEAN, 'std': IMAGENET_DEFAULT_STD,
23002301
'first_conv': 'stem.conv1.conv', 'classifier': 'head.fc',
2302+
'license': 'apache-2.0',
23012303
**kwargs
23022304
}
23032305

@@ -2451,26 +2453,31 @@ def _cfgr(url: str = '', **kwargs) -> Dict[str, Any]:
24512453
hf_hub_id='timm/',
24522454
crop_pct=0.875,
24532455
first_conv=('stem.conv_kxk.0.conv', 'stem.conv_scale.conv'),
2456+
license='other',
24542457
),
24552458
'mobileone_s1.apple_in1k': _cfg(
24562459
hf_hub_id='timm/',
24572460
crop_pct=0.9,
24582461
first_conv=('stem.conv_kxk.0.conv', 'stem.conv_scale.conv'),
2462+
license='other',
24592463
),
24602464
'mobileone_s2.apple_in1k': _cfg(
24612465
hf_hub_id='timm/',
24622466
crop_pct=0.9,
24632467
first_conv=('stem.conv_kxk.0.conv', 'stem.conv_scale.conv'),
2468+
license='other',
24642469
),
24652470
'mobileone_s3.apple_in1k': _cfg(
24662471
hf_hub_id='timm/',
24672472
crop_pct=0.9,
24682473
first_conv=('stem.conv_kxk.0.conv', 'stem.conv_scale.conv'),
2474+
license='other',
24692475
),
24702476
'mobileone_s4.apple_in1k': _cfg(
24712477
hf_hub_id='timm/',
24722478
crop_pct=0.9,
24732479
first_conv=('stem.conv_kxk.0.conv', 'stem.conv_scale.conv'),
2480+
license='other',
24742481
),
24752482

24762483
# original attention pool head variants
@@ -2479,90 +2486,106 @@ def _cfgr(url: str = '', **kwargs) -> Dict[str, Any]:
24792486
num_classes=1024, mean=OPENAI_CLIP_MEAN, std=OPENAI_CLIP_STD,
24802487
fixed_input_size=True, input_size=(3, 224, 224), pool_size=(7, 7),
24812488
classifier='head.proj',
2489+
license='mit',
24822490
),
24832491
'resnet101_clip.openai': _cfgr(
24842492
hf_hub_id='timm/',
24852493
num_classes=512, mean=OPENAI_CLIP_MEAN, std=OPENAI_CLIP_STD,
24862494
fixed_input_size=True, input_size=(3, 224, 224), pool_size=(7, 7),
24872495
classifier='head.proj',
2496+
license='mit',
24882497
),
24892498
'resnet50x4_clip.openai': _cfgr(
24902499
hf_hub_id='timm/',
24912500
num_classes=640, mean=OPENAI_CLIP_MEAN, std=OPENAI_CLIP_STD,
24922501
fixed_input_size=True, input_size=(3, 288, 288), pool_size=(9, 9),
24932502
classifier='head.proj',
2503+
license='mit',
24942504
),
24952505
'resnet50x16_clip.openai': _cfgr(
24962506
hf_hub_id='timm/',
24972507
num_classes=768, mean=OPENAI_CLIP_MEAN, std=OPENAI_CLIP_STD,
24982508
fixed_input_size=True, input_size=(3, 384, 384), pool_size=(12, 12),
24992509
classifier='head.proj',
2510+
license='mit',
25002511
),
25012512
'resnet50x64_clip.openai': _cfgr(
25022513
hf_hub_id='timm/',
25032514
num_classes=1024, mean=OPENAI_CLIP_MEAN, std=OPENAI_CLIP_STD,
25042515
fixed_input_size=True, input_size=(3, 448, 448), pool_size=(14, 14),
25052516
classifier='head.proj',
2517+
license='mit',
25062518
),
25072519
'resnet50_clip.cc12m': _cfgr(
25082520
hf_hub_id='timm/',
25092521
num_classes=1024, mean=OPENAI_CLIP_MEAN, std=OPENAI_CLIP_STD,
25102522
fixed_input_size=True, input_size=(3, 224, 224), pool_size=(7, 7),
25112523
classifier='head.proj',
2524+
license='mit',
25122525
),
25132526
'resnet50_clip.yfcc15m': _cfgr(
25142527
hf_hub_id='timm/',
25152528
num_classes=1024, mean=OPENAI_CLIP_MEAN, std=OPENAI_CLIP_STD,
25162529
fixed_input_size=True, input_size=(3, 224, 224), pool_size=(7, 7),
25172530
classifier='head.proj',
2531+
license='mit',
25182532
),
25192533
'resnet101_clip.yfcc15m': _cfgr(
25202534
hf_hub_id='timm/',
25212535
num_classes=512, mean=OPENAI_CLIP_MEAN, std=OPENAI_CLIP_STD,
25222536
fixed_input_size=True, input_size=(3, 224, 224), pool_size=(7, 7),
25232537
classifier='head.proj',
2538+
license='mit',
25242539
),
25252540

25262541
# avg-pool w/ optional standard classifier head variants
25272542
'resnet50_clip_gap.openai': _cfgr(
25282543
hf_hub_id='timm/',
25292544
num_classes=0, mean=OPENAI_CLIP_MEAN, std=OPENAI_CLIP_STD,
25302545
input_size=(3, 224, 224), pool_size=(7, 7),
2546+
license='mit',
25312547
),
25322548
'resnet101_clip_gap.openai': _cfgr(
25332549
hf_hub_id='timm/',
25342550
num_classes=0, mean=OPENAI_CLIP_MEAN, std=OPENAI_CLIP_STD,
25352551
input_size=(3, 224, 224), pool_size=(7, 7),
2552+
license='mit',
25362553
),
25372554
'resnet50x4_clip_gap.openai': _cfgr(
25382555
hf_hub_id='timm/',
25392556
num_classes=0, mean=OPENAI_CLIP_MEAN, std=OPENAI_CLIP_STD,
25402557
input_size=(3, 288, 288), pool_size=(9, 9),
2558+
license='mit',
25412559
),
25422560
'resnet50x16_clip_gap.openai': _cfgr(
25432561
hf_hub_id='timm/',
25442562
num_classes=0, mean=OPENAI_CLIP_MEAN, std=OPENAI_CLIP_STD,
25452563
input_size=(3, 384, 384), pool_size=(12, 12),
2564+
license='mit',
25462565
),
25472566
'resnet50x64_clip_gap.openai': _cfgr(
25482567
hf_hub_id='timm/',
25492568
num_classes=0, mean=OPENAI_CLIP_MEAN, std=OPENAI_CLIP_STD,
25502569
input_size=(3, 448, 448), pool_size=(14, 14),
2570+
license='mit',
25512571
),
25522572
'resnet50_clip_gap.cc12m': _cfgr(
25532573
hf_hub_id='timm/',
25542574
num_classes=0, mean=OPENAI_CLIP_MEAN, std=OPENAI_CLIP_STD,
25552575
input_size=(3, 224, 224), pool_size=(7, 7),
2576+
license='mit',
25562577
),
25572578
'resnet50_clip_gap.yfcc15m': _cfgr(
25582579
hf_hub_id='timm/',
25592580
num_classes=0, mean=OPENAI_CLIP_MEAN, std=OPENAI_CLIP_STD,
25602581
input_size=(3, 224, 224), pool_size=(7, 7),
2582+
license='mit',
25612583
),
25622584
'resnet101_clip_gap.yfcc15m': _cfgr(
25632585
hf_hub_id='timm/',
25642586
num_classes=0, mean=OPENAI_CLIP_MEAN, std=OPENAI_CLIP_STD,
25652587
input_size=(3, 224, 224), pool_size=(7, 7),
2588+
license='mit',
25662589
),
25672590

25682591
'resnet50_mlp.untrained': _cfgr(

timm/models/cait.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,7 @@ def _cfg(url='', **kwargs):
472472
'crop_pct': 1.0, 'interpolation': 'bicubic', 'fixed_input_size': True,
473473
'mean': IMAGENET_DEFAULT_MEAN, 'std': IMAGENET_DEFAULT_STD,
474474
'first_conv': 'patch_embed.proj', 'classifier': 'head',
475+
'license': 'apache-2.0',
475476
**kwargs
476477
}
477478

timm/models/coat.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -720,6 +720,7 @@ def _cfg_coat(url='', **kwargs):
720720
'crop_pct': .9, 'interpolation': 'bicubic', 'fixed_input_size': True,
721721
'mean': IMAGENET_DEFAULT_MEAN, 'std': IMAGENET_DEFAULT_STD,
722722
'first_conv': 'patch_embed1.proj', 'classifier': 'head',
723+
'license': 'apache-2.0',
723724
**kwargs
724725
}
725726

@@ -800,4 +801,4 @@ def coat_lite_medium_384(pretrained=False, **kwargs) -> CoaT:
800801
model_cfg = dict(
801802
img_size=384, patch_size=4, embed_dims=[128, 256, 320, 512], serial_depths=[3, 6, 10, 8])
802803
model = _create_coat('coat_lite_medium_384', pretrained=pretrained, **dict(model_cfg, **kwargs))
803-
return model
804+
return model

timm/models/convit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ def _cfg(url='', **kwargs):
391391
'url': url,
392392
'num_classes': 1000, 'input_size': (3, 224, 224), 'pool_size': None,
393393
'mean': IMAGENET_DEFAULT_MEAN, 'std': IMAGENET_DEFAULT_STD, 'fixed_input_size': True,
394-
'first_conv': 'patch_embed.proj', 'classifier': 'head',
394+
'first_conv': 'patch_embed.proj', 'classifier': 'head', 'license': 'apache-2.0',
395395
**kwargs
396396
}
397397

timm/models/convmixer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def _cfg(url='', **kwargs):
115115
'num_classes': 1000, 'input_size': (3, 224, 224), 'pool_size': None,
116116
'crop_pct': .96, 'interpolation': 'bicubic',
117117
'mean': IMAGENET_DEFAULT_MEAN, 'std': IMAGENET_DEFAULT_STD, 'classifier': 'head',
118-
'first_conv': 'stem.0',
118+
'first_conv': 'stem.0', 'license': 'mit',
119119
**kwargs
120120
}
121121

@@ -143,4 +143,4 @@ def convmixer_768_32(pretrained=False, **kwargs) -> ConvMixer:
143143
@register_model
144144
def convmixer_1024_20_ks9_p14(pretrained=False, **kwargs) -> ConvMixer:
145145
model_args = dict(dim=1024, depth=20, kernel_size=9, patch_size=14, **kwargs)
146-
return _create_convmixer('convmixer_1024_20_ks9_p14', pretrained, **model_args)
146+
return _create_convmixer('convmixer_1024_20_ks9_p14', pretrained, **model_args)

timm/models/convnext.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,7 @@ def _cfg(url='', **kwargs):
665665
'crop_pct': 0.875, 'interpolation': 'bicubic',
666666
'mean': IMAGENET_DEFAULT_MEAN, 'std': IMAGENET_DEFAULT_STD,
667667
'first_conv': 'stem.0', 'classifier': 'head.fc',
668-
**kwargs
668+
'license': 'apache-2.0', **kwargs
669669
}
670670

671671

timm/models/crossvit.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,7 @@ def _cfg(url='', **kwargs):
489489
'mean': IMAGENET_DEFAULT_MEAN, 'std': IMAGENET_DEFAULT_STD, 'fixed_input_size': True,
490490
'first_conv': ('patch_embed.0.proj', 'patch_embed.1.proj'),
491491
'classifier': ('head.0', 'head.1'),
492+
'license': 'apache-2.0',
492493
**kwargs
493494
}
494495

0 commit comments

Comments
 (0)