|
44 | 44 | from torch.utils.checkpoint import checkpoint |
45 | 45 |
|
46 | 46 | from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD, IMAGENET_INCEPTION_MEAN, IMAGENET_INCEPTION_STD |
47 | | -from timm.layers import create_conv2d, create_classifier, get_norm_act_layer, GroupNormAct, LayerType |
| 47 | +from timm.layers import create_conv2d, create_classifier, get_norm_act_layer, LayerType, \ |
| 48 | + GroupNormAct, LayerNormAct2d, EvoNorm2dS0 |
48 | 49 | from ._builder import build_model_with_cfg, pretrained_cfg_for_features |
49 | 50 | from ._efficientnet_blocks import SqueezeExcite |
50 | 51 | from ._efficientnet_builder import BlockArgs, EfficientNetBuilder, decode_arch_def, efficientnet_init_weights, \ |
@@ -1808,6 +1809,14 @@ def _cfg(url='', **kwargs): |
1808 | 1809 | hf_hub_id='timm/', |
1809 | 1810 | mean=(0.5, 0.5, 0.5), std=(0.5, 0.5, 0.5), |
1810 | 1811 | input_size=(3, 160, 160), pool_size=(5, 5)), |
| 1812 | + "test_efficientnet_ln.r160_in1k": _cfg( |
| 1813 | + #hf_hub_id='timm/', |
| 1814 | + mean=(0.5, 0.5, 0.5), std=(0.5, 0.5, 0.5), |
| 1815 | + input_size=(3, 160, 160), pool_size=(5, 5)), |
| 1816 | + "test_efficientnet_evos.r160_in1k": _cfg( |
| 1817 | + #hf_hub_id='timm/', |
| 1818 | + mean=(0.5, 0.5, 0.5), std=(0.5, 0.5, 0.5), |
| 1819 | + input_size=(3, 160, 160), pool_size=(5, 5)), |
1811 | 1820 | }) |
1812 | 1821 |
|
1813 | 1822 |
|
@@ -2802,6 +2811,21 @@ def test_efficientnet_gn(pretrained=False, **kwargs) -> EfficientNet: |
2802 | 2811 | 'test_efficientnet_gn', pretrained=pretrained, norm_layer=partial(GroupNormAct, group_size=8), **kwargs) |
2803 | 2812 | return model |
2804 | 2813 |
|
| 2814 | + |
| 2815 | +@register_model |
| 2816 | +def test_efficientnet_ln(pretrained=False, **kwargs) -> EfficientNet: |
| 2817 | + model = _gen_test_efficientnet( |
| 2818 | + 'test_efficientnet_ln', pretrained=pretrained, norm_layer=LayerNormAct2d, **kwargs) |
| 2819 | + return model |
| 2820 | + |
| 2821 | + |
| 2822 | +@register_model |
| 2823 | +def test_efficientnet_evos(pretrained=False, **kwargs) -> EfficientNet: |
| 2824 | + model = _gen_test_efficientnet( |
| 2825 | + 'test_efficientnet_evos', pretrained=pretrained, norm_layer=partial(EvoNorm2dS0, group_size=8), **kwargs) |
| 2826 | + return model |
| 2827 | + |
| 2828 | + |
2805 | 2829 | register_model_deprecations(__name__, { |
2806 | 2830 | 'tf_efficientnet_b0_ap': 'tf_efficientnet_b0.ap_in1k', |
2807 | 2831 | 'tf_efficientnet_b1_ap': 'tf_efficientnet_b1.ap_in1k', |
|
0 commit comments