Skip to content

Commit 1e35a5d

Browse files
alexanderdannrwightman
authored andcommitted
Updating licenses
1 parent e0e79a1 commit 1e35a5d

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
@@ -568,8 +568,13 @@ def _get_license_from_hf_hub(model_id: str | None, hf_hub_id: str | None) -> str
568568
info = model_info(repo_id=repo_id)
569569

570570
except RepositoryNotFoundError:
571-
# TODO: any wish what happens here? @rwightman
572-
print(repo_id)
571+
msg = f"Repository {repo_id} was not found. Manual inspection of license needed."
572+
_logger.warning(msg=msg)
573+
return None
574+
575+
except Exception as _:
576+
msg = f"Error for {repo_id}. Manual inspection of license needed."
577+
_logger.warning(msg=msg)
573578
return None
574579

575580
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
@@ -773,6 +773,7 @@ def _cfg(url: str = '', **kwargs) -> Dict[str, Any]:
773773
'crop_pct': .9, 'interpolation': 'bicubic', 'fixed_input_size': True,
774774
'mean': (0.5, 0.5, 0.5), 'std': (0.5, 0.5, 0.5),
775775
'first_conv': 'patch_embed.proj', 'classifier': 'head',
776+
'license': 'apache-2.0',
776777
**kwargs
777778
}
778779

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
@@ -2432,6 +2432,7 @@ def _cfg(url: str = '', **kwargs) -> Dict[str, Any]:
24322432
'crop_pct': 0.875, 'interpolation': 'bilinear',
24332433
'mean': IMAGENET_DEFAULT_MEAN, 'std': IMAGENET_DEFAULT_STD,
24342434
'first_conv': 'stem.conv', 'classifier': 'head.fc',
2435+
'license': 'apache-2.0',
24352436
**kwargs
24362437
}
24372438

@@ -2451,6 +2452,7 @@ def _cfgr(url: str = '', **kwargs) -> Dict[str, Any]:
24512452
'crop_pct': 0.9, 'interpolation': 'bicubic',
24522453
'mean': IMAGENET_DEFAULT_MEAN, 'std': IMAGENET_DEFAULT_STD,
24532454
'first_conv': 'stem.conv1.conv', 'classifier': 'head.fc',
2455+
'license': 'apache-2.0',
24542456
**kwargs
24552457
}
24562458

@@ -2604,26 +2606,31 @@ def _cfgr(url: str = '', **kwargs) -> Dict[str, Any]:
26042606
hf_hub_id='timm/',
26052607
crop_pct=0.875,
26062608
first_conv=('stem.conv_kxk.0.conv', 'stem.conv_scale.conv'),
2609+
license='other',
26072610
),
26082611
'mobileone_s1.apple_in1k': _cfg(
26092612
hf_hub_id='timm/',
26102613
crop_pct=0.9,
26112614
first_conv=('stem.conv_kxk.0.conv', 'stem.conv_scale.conv'),
2615+
license='other',
26122616
),
26132617
'mobileone_s2.apple_in1k': _cfg(
26142618
hf_hub_id='timm/',
26152619
crop_pct=0.9,
26162620
first_conv=('stem.conv_kxk.0.conv', 'stem.conv_scale.conv'),
2621+
license='other',
26172622
),
26182623
'mobileone_s3.apple_in1k': _cfg(
26192624
hf_hub_id='timm/',
26202625
crop_pct=0.9,
26212626
first_conv=('stem.conv_kxk.0.conv', 'stem.conv_scale.conv'),
2627+
license='other',
26222628
),
26232629
'mobileone_s4.apple_in1k': _cfg(
26242630
hf_hub_id='timm/',
26252631
crop_pct=0.9,
26262632
first_conv=('stem.conv_kxk.0.conv', 'stem.conv_scale.conv'),
2633+
license='other',
26272634
),
26282635

26292636
# original attention pool head variants
@@ -2632,90 +2639,106 @@ def _cfgr(url: str = '', **kwargs) -> Dict[str, Any]:
26322639
num_classes=1024, mean=OPENAI_CLIP_MEAN, std=OPENAI_CLIP_STD,
26332640
fixed_input_size=True, input_size=(3, 224, 224), pool_size=(7, 7),
26342641
classifier='head.proj',
2642+
license='mit',
26352643
),
26362644
'resnet101_clip.openai': _cfgr(
26372645
hf_hub_id='timm/',
26382646
num_classes=512, mean=OPENAI_CLIP_MEAN, std=OPENAI_CLIP_STD,
26392647
fixed_input_size=True, input_size=(3, 224, 224), pool_size=(7, 7),
26402648
classifier='head.proj',
2649+
license='mit',
26412650
),
26422651
'resnet50x4_clip.openai': _cfgr(
26432652
hf_hub_id='timm/',
26442653
num_classes=640, mean=OPENAI_CLIP_MEAN, std=OPENAI_CLIP_STD,
26452654
fixed_input_size=True, input_size=(3, 288, 288), pool_size=(9, 9),
26462655
classifier='head.proj',
2656+
license='mit',
26472657
),
26482658
'resnet50x16_clip.openai': _cfgr(
26492659
hf_hub_id='timm/',
26502660
num_classes=768, mean=OPENAI_CLIP_MEAN, std=OPENAI_CLIP_STD,
26512661
fixed_input_size=True, input_size=(3, 384, 384), pool_size=(12, 12),
26522662
classifier='head.proj',
2663+
license='mit',
26532664
),
26542665
'resnet50x64_clip.openai': _cfgr(
26552666
hf_hub_id='timm/',
26562667
num_classes=1024, mean=OPENAI_CLIP_MEAN, std=OPENAI_CLIP_STD,
26572668
fixed_input_size=True, input_size=(3, 448, 448), pool_size=(14, 14),
26582669
classifier='head.proj',
2670+
license='mit',
26592671
),
26602672
'resnet50_clip.cc12m': _cfgr(
26612673
hf_hub_id='timm/',
26622674
num_classes=1024, mean=OPENAI_CLIP_MEAN, std=OPENAI_CLIP_STD,
26632675
fixed_input_size=True, input_size=(3, 224, 224), pool_size=(7, 7),
26642676
classifier='head.proj',
2677+
license='mit',
26652678
),
26662679
'resnet50_clip.yfcc15m': _cfgr(
26672680
hf_hub_id='timm/',
26682681
num_classes=1024, mean=OPENAI_CLIP_MEAN, std=OPENAI_CLIP_STD,
26692682
fixed_input_size=True, input_size=(3, 224, 224), pool_size=(7, 7),
26702683
classifier='head.proj',
2684+
license='mit',
26712685
),
26722686
'resnet101_clip.yfcc15m': _cfgr(
26732687
hf_hub_id='timm/',
26742688
num_classes=512, mean=OPENAI_CLIP_MEAN, std=OPENAI_CLIP_STD,
26752689
fixed_input_size=True, input_size=(3, 224, 224), pool_size=(7, 7),
26762690
classifier='head.proj',
2691+
license='mit',
26772692
),
26782693

26792694
# avg-pool w/ optional standard classifier head variants
26802695
'resnet50_clip_gap.openai': _cfgr(
26812696
hf_hub_id='timm/',
26822697
num_classes=0, mean=OPENAI_CLIP_MEAN, std=OPENAI_CLIP_STD,
26832698
input_size=(3, 224, 224), pool_size=(7, 7),
2699+
license='mit',
26842700
),
26852701
'resnet101_clip_gap.openai': _cfgr(
26862702
hf_hub_id='timm/',
26872703
num_classes=0, mean=OPENAI_CLIP_MEAN, std=OPENAI_CLIP_STD,
26882704
input_size=(3, 224, 224), pool_size=(7, 7),
2705+
license='mit',
26892706
),
26902707
'resnet50x4_clip_gap.openai': _cfgr(
26912708
hf_hub_id='timm/',
26922709
num_classes=0, mean=OPENAI_CLIP_MEAN, std=OPENAI_CLIP_STD,
26932710
input_size=(3, 288, 288), pool_size=(9, 9),
2711+
license='mit',
26942712
),
26952713
'resnet50x16_clip_gap.openai': _cfgr(
26962714
hf_hub_id='timm/',
26972715
num_classes=0, mean=OPENAI_CLIP_MEAN, std=OPENAI_CLIP_STD,
26982716
input_size=(3, 384, 384), pool_size=(12, 12),
2717+
license='mit',
26992718
),
27002719
'resnet50x64_clip_gap.openai': _cfgr(
27012720
hf_hub_id='timm/',
27022721
num_classes=0, mean=OPENAI_CLIP_MEAN, std=OPENAI_CLIP_STD,
27032722
input_size=(3, 448, 448), pool_size=(14, 14),
2723+
license='mit',
27042724
),
27052725
'resnet50_clip_gap.cc12m': _cfgr(
27062726
hf_hub_id='timm/',
27072727
num_classes=0, mean=OPENAI_CLIP_MEAN, std=OPENAI_CLIP_STD,
27082728
input_size=(3, 224, 224), pool_size=(7, 7),
2729+
license='mit',
27092730
),
27102731
'resnet50_clip_gap.yfcc15m': _cfgr(
27112732
hf_hub_id='timm/',
27122733
num_classes=0, mean=OPENAI_CLIP_MEAN, std=OPENAI_CLIP_STD,
27132734
input_size=(3, 224, 224), pool_size=(7, 7),
2735+
license='mit',
27142736
),
27152737
'resnet101_clip_gap.yfcc15m': _cfgr(
27162738
hf_hub_id='timm/',
27172739
num_classes=0, mean=OPENAI_CLIP_MEAN, std=OPENAI_CLIP_STD,
27182740
input_size=(3, 224, 224), pool_size=(7, 7),
2741+
license='mit',
27192742
),
27202743

27212744
'resnet50_mlp.untrained': _cfgr(

timm/models/cait.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,7 @@ def _cfg(url='', **kwargs):
508508
'crop_pct': 1.0, 'interpolation': 'bicubic', 'fixed_input_size': True,
509509
'mean': IMAGENET_DEFAULT_MEAN, 'std': IMAGENET_DEFAULT_STD,
510510
'first_conv': 'patch_embed.proj', 'classifier': 'head',
511+
'license': 'apache-2.0',
511512
**kwargs
512513
}
513514

timm/models/coat.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -759,6 +759,7 @@ def _cfg_coat(url='', **kwargs):
759759
'crop_pct': .9, 'interpolation': 'bicubic', 'fixed_input_size': True,
760760
'mean': IMAGENET_DEFAULT_MEAN, 'std': IMAGENET_DEFAULT_STD,
761761
'first_conv': 'patch_embed1.proj', 'classifier': 'head',
762+
'license': 'apache-2.0',
762763
**kwargs
763764
}
764765

@@ -839,4 +840,4 @@ def coat_lite_medium_384(pretrained=False, **kwargs) -> CoaT:
839840
model_cfg = dict(
840841
img_size=384, patch_size=4, embed_dims=[128, 256, 320, 512], serial_depths=[3, 6, 10, 8])
841842
model = _create_coat('coat_lite_medium_384', pretrained=pretrained, **dict(model_cfg, **kwargs))
842-
return model
843+
return model

timm/models/convit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ def _cfg(url='', **kwargs):
420420
'url': url,
421421
'num_classes': 1000, 'input_size': (3, 224, 224), 'pool_size': None,
422422
'mean': IMAGENET_DEFAULT_MEAN, 'std': IMAGENET_DEFAULT_STD, 'fixed_input_size': True,
423-
'first_conv': 'patch_embed.proj', 'classifier': 'head',
423+
'first_conv': 'patch_embed.proj', 'classifier': 'head', 'license': 'apache-2.0',
424424
**kwargs
425425
}
426426

timm/models/convmixer.py

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

@@ -146,4 +146,4 @@ def convmixer_768_32(pretrained=False, **kwargs) -> ConvMixer:
146146
@register_model
147147
def convmixer_1024_20_ks9_p14(pretrained=False, **kwargs) -> ConvMixer:
148148
model_args = dict(dim=1024, depth=20, kernel_size=9, patch_size=14, **kwargs)
149-
return _create_convmixer('convmixer_1024_20_ks9_p14', pretrained, **model_args)
149+
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
@@ -711,7 +711,7 @@ def _cfg(url='', **kwargs):
711711
'crop_pct': 0.875, 'interpolation': 'bicubic',
712712
'mean': IMAGENET_DEFAULT_MEAN, 'std': IMAGENET_DEFAULT_STD,
713713
'first_conv': 'stem.0', 'classifier': 'head.fc',
714-
**kwargs
714+
'license': 'apache-2.0', **kwargs
715715
}
716716

717717

timm/models/crossvit.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,7 @@ def _cfg(url='', **kwargs):
519519
'mean': IMAGENET_DEFAULT_MEAN, 'std': IMAGENET_DEFAULT_STD, 'fixed_input_size': True,
520520
'first_conv': ('patch_embed.0.proj', 'patch_embed.1.proj'),
521521
'classifier': ('head.0', 'head.1'),
522+
'license': 'apache-2.0',
522523
**kwargs
523524
}
524525

0 commit comments

Comments
 (0)