2222from timm .data import IMAGENET_DEFAULT_MEAN , IMAGENET_DEFAULT_STD
2323from timm .layers import ClassifierHead , ConvNormAct , DropPath , 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
@@ -919,97 +918,82 @@ def _cfg(url='', **kwargs):
919918 'crop_pct' : 0.887 , 'interpolation' : 'bilinear' ,
920919 'mean' : IMAGENET_DEFAULT_MEAN , 'std' : IMAGENET_DEFAULT_STD ,
921920 'first_conv' : 'stem.conv1.conv' , 'classifier' : 'head.fc' ,
922- 'license' : _get_license_from_hf_hub (kwargs .pop ('model_id' , None ), kwargs .get ('hf_hub_id' )),
923921 ** kwargs
924922 }
925923
924+
926925default_cfgs = generate_default_cfgs ({
927926 'cspresnet50.ra_in1k' : _cfg (
928927 hf_hub_id = 'timm/' ,
929- model_id = 'cspresnet50.ra_in1k' ,
930928 url = 'https://github.com/rwightman/pytorch-image-models/releases/download/v0.1-weights/cspresnet50_ra-d3e8d487.pth' ),
931929 'cspresnet50d.untrained' : _cfg (),
932930 'cspresnet50w.untrained' : _cfg (),
933931 'cspresnext50.ra_in1k' : _cfg (
934932 hf_hub_id = 'timm/' ,
935- model_id = 'cspresnext50.ra_in1k' ,
936933 url = 'https://github.com/rwightman/pytorch-image-models/releases/download/v0.1-weights/cspresnext50_ra_224-648b4713.pth' ,
937934 ),
938935 'cspdarknet53.ra_in1k' : _cfg (
939936 hf_hub_id = 'timm/' ,
940- model_id = 'cspdarknet53.ra_in1k' ,
941937 url = 'https://github.com/rwightman/pytorch-image-models/releases/download/v0.1-weights/cspdarknet53_ra_256-d05c7c21.pth' ),
942938
943939 'darknet17.untrained' : _cfg (),
944940 'darknet21.untrained' : _cfg (),
945941 'sedarknet21.untrained' : _cfg (),
946942 'darknet53.c2ns_in1k' : _cfg (
947943 hf_hub_id = 'timm/' ,
948- model_id = 'darknet53.c2ns_in1k' ,
949944 url = 'https://github.com/rwightman/pytorch-image-models/releases/download/v0.1-tpu-weights/darknet53_256_c2ns-3aeff817.pth' ,
950945 interpolation = 'bicubic' , test_input_size = (3 , 288 , 288 ), test_crop_pct = 1.0 ),
951946 'darknetaa53.c2ns_in1k' : _cfg (
952947 hf_hub_id = 'timm/' ,
953- model_id = 'darknetaa53.c2ns_in1k' ,
954948 url = 'https://github.com/rwightman/pytorch-image-models/releases/download/v0.1-tpu-weights/darknetaa53_c2ns-5c28ec8a.pth' ,
955949 test_input_size = (3 , 288 , 288 ), test_crop_pct = 1.0 ),
956950
957951 'cs3darknet_s.untrained' : _cfg (interpolation = 'bicubic' ),
958952 'cs3darknet_m.c2ns_in1k' : _cfg (
959953 hf_hub_id = 'timm/' ,
960- model_id = 'cs3darknet_m.c2ns_in1k' ,
961954 url = 'https://github.com/rwightman/pytorch-image-models/releases/download/v0.1-tpu-weights/cs3darknet_m_c2ns-43f06604.pth' ,
962955 interpolation = 'bicubic' , test_input_size = (3 , 288 , 288 ), test_crop_pct = 0.95 ,
963956 ),
964957 'cs3darknet_l.c2ns_in1k' : _cfg (
965958 hf_hub_id = 'timm/' ,
966- model_id = 'cs3darknet_l.c2ns_in1k' ,
967959 url = 'https://github.com/rwightman/pytorch-image-models/releases/download/v0.1-tpu-weights/cs3darknet_l_c2ns-16220c5d.pth' ,
968960 interpolation = 'bicubic' , test_input_size = (3 , 288 , 288 ), test_crop_pct = 0.95 ),
969961 'cs3darknet_x.c2ns_in1k' : _cfg (
970962 hf_hub_id = 'timm/' ,
971- model_id = 'cs3darknet_x.c2ns_in1k' ,
972963 url = 'https://github.com/rwightman/pytorch-image-models/releases/download/v0.1-tpu-weights/cs3darknet_x_c2ns-4e4490aa.pth' ,
973964 interpolation = 'bicubic' , crop_pct = 0.95 , test_input_size = (3 , 288 , 288 ), test_crop_pct = 1.0 ),
974965
975966 'cs3darknet_focus_s.ra4_e3600_r256_in1k' : _cfg (
976967 hf_hub_id = 'timm/' ,
977- model_id = 'cs3darknet_focus_s.ra4_e3600_r256_in1k' ,
978968 mean = (0.5 , 0.5 , 0.5 ), std = (0.5 , 0.5 , 0.5 ),
979969 interpolation = 'bicubic' , test_input_size = (3 , 320 , 320 ), test_crop_pct = 1.0 ),
980970 'cs3darknet_focus_m.c2ns_in1k' : _cfg (
981971 hf_hub_id = 'timm/' ,
982- model_id = 'cs3darknet_focus_m.c2ns_in1k' ,
983972 url = 'https://github.com/rwightman/pytorch-image-models/releases/download/v0.1-tpu-weights/cs3darknet_focus_m_c2ns-e23bed41.pth' ,
984973 interpolation = 'bicubic' , test_input_size = (3 , 288 , 288 ), test_crop_pct = 0.95 ),
985974 'cs3darknet_focus_l.c2ns_in1k' : _cfg (
986975 hf_hub_id = 'timm/' ,
987- model_id = 'cs3darknet_focus_l.c2ns_in1k' ,
988976 url = 'https://github.com/rwightman/pytorch-image-models/releases/download/v0.1-tpu-weights/cs3darknet_focus_l_c2ns-65ef8888.pth' ,
989977 interpolation = 'bicubic' , test_input_size = (3 , 288 , 288 ), test_crop_pct = 0.95 ),
990978 'cs3darknet_focus_x.untrained' : _cfg (interpolation = 'bicubic' ),
991979
992980 'cs3sedarknet_l.c2ns_in1k' : _cfg (
993981 hf_hub_id = 'timm/' ,
994- model_id = 'cs3sedarknet_l.c2ns_in1k' ,
995982 url = 'https://github.com/rwightman/pytorch-image-models/releases/download/v0.1-tpu-weights/cs3sedarknet_l_c2ns-e8d1dc13.pth' ,
996983 interpolation = 'bicubic' , test_input_size = (3 , 288 , 288 ), test_crop_pct = 0.95 ),
997984 'cs3sedarknet_x.c2ns_in1k' : _cfg (
998985 hf_hub_id = 'timm/' ,
999- model_id = 'cs3sedarknet_x.c2ns_in1k' ,
1000986 url = 'https://github.com/rwightman/pytorch-image-models/releases/download/v0.1-tpu-weights/cs3sedarknet_x_c2ns-b4d0abc0.pth' ,
1001987 interpolation = 'bicubic' , test_input_size = (3 , 288 , 288 ), test_crop_pct = 1.0 ),
1002988
1003989 'cs3sedarknet_xdw.untrained' : _cfg (interpolation = 'bicubic' ),
1004990
1005991 'cs3edgenet_x.c2_in1k' : _cfg (
1006992 hf_hub_id = 'timm/' ,
1007- model_id = 'cs3edgenet_x.c2_in1k' ,
1008993 url = 'https://github.com/rwightman/pytorch-image-models/releases/download/v0.1-tpu-weights/cs3edgenet_x_c2-2e1610a9.pth' ,
1009994 interpolation = 'bicubic' , test_input_size = (3 , 288 , 288 ), test_crop_pct = 1.0 ),
1010995 'cs3se_edgenet_x.c2ns_in1k' : _cfg (
1011996 hf_hub_id = 'timm/' ,
1012- model_id = 'cs3se_edgenet_x.c2ns_in1k' ,
1013997 url = 'https://github.com/rwightman/pytorch-image-models/releases/download/v0.1-tpu-weights/cs3se_edgenet_x_c2ns-76f8e3ac.pth' ,
1014998 interpolation = 'bicubic' , crop_pct = 0.95 , test_input_size = (3 , 320 , 320 ), test_crop_pct = 1.0 ),
1015999})
@@ -1127,4 +1111,4 @@ def cs3edgenet_x(pretrained=False, **kwargs) -> CspNet:
11271111
11281112@register_model
11291113def cs3se_edgenet_x (pretrained = False , ** kwargs ) -> CspNet :
1130- return _create_cspnet ('cs3se_edgenet_x' , pretrained = pretrained , ** kwargs )
1114+ return _create_cspnet ('cs3se_edgenet_x' , pretrained = pretrained , ** kwargs )
0 commit comments