2222from timm .data import IMAGENET_DEFAULT_MEAN , IMAGENET_DEFAULT_STD
2323from timm .layers import ClassifierHead , ConvNormAct , DropPath , calculate_drop_path_rates , get_attn , create_act_layer , make_divisible
2424from ._builder import build_model_with_cfg
25- from ._hub import _get_license_from_hf_hub
2625from ._manipulate import named_apply , MATCH_PREV_GROUP
2726from ._registry import register_model , generate_default_cfgs
2827
@@ -1012,97 +1011,82 @@ def _cfg(url='', **kwargs):
10121011 'crop_pct' : 0.887 , 'interpolation' : 'bilinear' ,
10131012 'mean' : IMAGENET_DEFAULT_MEAN , 'std' : IMAGENET_DEFAULT_STD ,
10141013 'first_conv' : 'stem.conv1.conv' , 'classifier' : 'head.fc' ,
1015- 'license' : _get_license_from_hf_hub (kwargs .pop ('model_id' , None ), kwargs .get ('hf_hub_id' )),
10161014 ** kwargs
10171015 }
10181016
1017+
10191018default_cfgs = generate_default_cfgs ({
10201019 'cspresnet50.ra_in1k' : _cfg (
10211020 hf_hub_id = 'timm/' ,
1022- model_id = 'cspresnet50.ra_in1k' ,
10231021 url = 'https://github.com/rwightman/pytorch-image-models/releases/download/v0.1-weights/cspresnet50_ra-d3e8d487.pth' ),
10241022 'cspresnet50d.untrained' : _cfg (),
10251023 'cspresnet50w.untrained' : _cfg (),
10261024 'cspresnext50.ra_in1k' : _cfg (
10271025 hf_hub_id = 'timm/' ,
1028- model_id = 'cspresnext50.ra_in1k' ,
10291026 url = 'https://github.com/rwightman/pytorch-image-models/releases/download/v0.1-weights/cspresnext50_ra_224-648b4713.pth' ,
10301027 ),
10311028 'cspdarknet53.ra_in1k' : _cfg (
10321029 hf_hub_id = 'timm/' ,
1033- model_id = 'cspdarknet53.ra_in1k' ,
10341030 url = 'https://github.com/rwightman/pytorch-image-models/releases/download/v0.1-weights/cspdarknet53_ra_256-d05c7c21.pth' ),
10351031
10361032 'darknet17.untrained' : _cfg (),
10371033 'darknet21.untrained' : _cfg (),
10381034 'sedarknet21.untrained' : _cfg (),
10391035 'darknet53.c2ns_in1k' : _cfg (
10401036 hf_hub_id = 'timm/' ,
1041- model_id = 'darknet53.c2ns_in1k' ,
10421037 url = 'https://github.com/rwightman/pytorch-image-models/releases/download/v0.1-tpu-weights/darknet53_256_c2ns-3aeff817.pth' ,
10431038 interpolation = 'bicubic' , test_input_size = (3 , 288 , 288 ), test_crop_pct = 1.0 ),
10441039 'darknetaa53.c2ns_in1k' : _cfg (
10451040 hf_hub_id = 'timm/' ,
1046- model_id = 'darknetaa53.c2ns_in1k' ,
10471041 url = 'https://github.com/rwightman/pytorch-image-models/releases/download/v0.1-tpu-weights/darknetaa53_c2ns-5c28ec8a.pth' ,
10481042 test_input_size = (3 , 288 , 288 ), test_crop_pct = 1.0 ),
10491043
10501044 'cs3darknet_s.untrained' : _cfg (interpolation = 'bicubic' ),
10511045 'cs3darknet_m.c2ns_in1k' : _cfg (
10521046 hf_hub_id = 'timm/' ,
1053- model_id = 'cs3darknet_m.c2ns_in1k' ,
10541047 url = 'https://github.com/rwightman/pytorch-image-models/releases/download/v0.1-tpu-weights/cs3darknet_m_c2ns-43f06604.pth' ,
10551048 interpolation = 'bicubic' , test_input_size = (3 , 288 , 288 ), test_crop_pct = 0.95 ,
10561049 ),
10571050 'cs3darknet_l.c2ns_in1k' : _cfg (
10581051 hf_hub_id = 'timm/' ,
1059- model_id = 'cs3darknet_l.c2ns_in1k' ,
10601052 url = 'https://github.com/rwightman/pytorch-image-models/releases/download/v0.1-tpu-weights/cs3darknet_l_c2ns-16220c5d.pth' ,
10611053 interpolation = 'bicubic' , test_input_size = (3 , 288 , 288 ), test_crop_pct = 0.95 ),
10621054 'cs3darknet_x.c2ns_in1k' : _cfg (
10631055 hf_hub_id = 'timm/' ,
1064- model_id = 'cs3darknet_x.c2ns_in1k' ,
10651056 url = 'https://github.com/rwightman/pytorch-image-models/releases/download/v0.1-tpu-weights/cs3darknet_x_c2ns-4e4490aa.pth' ,
10661057 interpolation = 'bicubic' , crop_pct = 0.95 , test_input_size = (3 , 288 , 288 ), test_crop_pct = 1.0 ),
10671058
10681059 'cs3darknet_focus_s.ra4_e3600_r256_in1k' : _cfg (
10691060 hf_hub_id = 'timm/' ,
1070- model_id = 'cs3darknet_focus_s.ra4_e3600_r256_in1k' ,
10711061 mean = (0.5 , 0.5 , 0.5 ), std = (0.5 , 0.5 , 0.5 ),
10721062 interpolation = 'bicubic' , test_input_size = (3 , 320 , 320 ), test_crop_pct = 1.0 ),
10731063 'cs3darknet_focus_m.c2ns_in1k' : _cfg (
10741064 hf_hub_id = 'timm/' ,
1075- model_id = 'cs3darknet_focus_m.c2ns_in1k' ,
10761065 url = 'https://github.com/rwightman/pytorch-image-models/releases/download/v0.1-tpu-weights/cs3darknet_focus_m_c2ns-e23bed41.pth' ,
10771066 interpolation = 'bicubic' , test_input_size = (3 , 288 , 288 ), test_crop_pct = 0.95 ),
10781067 'cs3darknet_focus_l.c2ns_in1k' : _cfg (
10791068 hf_hub_id = 'timm/' ,
1080- model_id = 'cs3darknet_focus_l.c2ns_in1k' ,
10811069 url = 'https://github.com/rwightman/pytorch-image-models/releases/download/v0.1-tpu-weights/cs3darknet_focus_l_c2ns-65ef8888.pth' ,
10821070 interpolation = 'bicubic' , test_input_size = (3 , 288 , 288 ), test_crop_pct = 0.95 ),
10831071 'cs3darknet_focus_x.untrained' : _cfg (interpolation = 'bicubic' ),
10841072
10851073 'cs3sedarknet_l.c2ns_in1k' : _cfg (
10861074 hf_hub_id = 'timm/' ,
1087- model_id = 'cs3sedarknet_l.c2ns_in1k' ,
10881075 url = 'https://github.com/rwightman/pytorch-image-models/releases/download/v0.1-tpu-weights/cs3sedarknet_l_c2ns-e8d1dc13.pth' ,
10891076 interpolation = 'bicubic' , test_input_size = (3 , 288 , 288 ), test_crop_pct = 0.95 ),
10901077 'cs3sedarknet_x.c2ns_in1k' : _cfg (
10911078 hf_hub_id = 'timm/' ,
1092- model_id = 'cs3sedarknet_x.c2ns_in1k' ,
10931079 url = 'https://github.com/rwightman/pytorch-image-models/releases/download/v0.1-tpu-weights/cs3sedarknet_x_c2ns-b4d0abc0.pth' ,
10941080 interpolation = 'bicubic' , test_input_size = (3 , 288 , 288 ), test_crop_pct = 1.0 ),
10951081
10961082 'cs3sedarknet_xdw.untrained' : _cfg (interpolation = 'bicubic' ),
10971083
10981084 'cs3edgenet_x.c2_in1k' : _cfg (
10991085 hf_hub_id = 'timm/' ,
1100- model_id = 'cs3edgenet_x.c2_in1k' ,
11011086 url = 'https://github.com/rwightman/pytorch-image-models/releases/download/v0.1-tpu-weights/cs3edgenet_x_c2-2e1610a9.pth' ,
11021087 interpolation = 'bicubic' , test_input_size = (3 , 288 , 288 ), test_crop_pct = 1.0 ),
11031088 'cs3se_edgenet_x.c2ns_in1k' : _cfg (
11041089 hf_hub_id = 'timm/' ,
1105- model_id = 'cs3se_edgenet_x.c2ns_in1k' ,
11061090 url = 'https://github.com/rwightman/pytorch-image-models/releases/download/v0.1-tpu-weights/cs3se_edgenet_x_c2ns-76f8e3ac.pth' ,
11071091 interpolation = 'bicubic' , crop_pct = 0.95 , test_input_size = (3 , 320 , 320 ), test_crop_pct = 1.0 ),
11081092})
@@ -1220,4 +1204,4 @@ def cs3edgenet_x(pretrained=False, **kwargs) -> CspNet:
12201204
12211205@register_model
12221206def cs3se_edgenet_x (pretrained = False , ** kwargs ) -> CspNet :
1223- return _create_cspnet ('cs3se_edgenet_x' , pretrained = pretrained , ** kwargs )
1207+ return _create_cspnet ('cs3se_edgenet_x' , pretrained = pretrained , ** kwargs )
0 commit comments