diff --git a/README.md b/README.md index a7e10290..88aef13c 100644 --- a/README.md +++ b/README.md @@ -23,11 +23,12 @@ I'm fortunate to be able to dedicate significant time and money of my own suppor ## What's New -### July 8, 2021 +### July 5-9, 2021 +* Add `efficientnetv2_rw_t` weights, a custom 'tiny' 13.6M param variant that is a bit better than (non NoisyStudent) B3 models. Both faster and better accuracy (at same or lower res) + * top-1 82.34 @ 288x288 and 82.54 @ 320x320 * Add [SAM pretrained](https://arxiv.org/abs/2106.01548) in1k weight for ViT B/16 (`vit_base_patch16_sam_224`) and B/32 (`vit_base_patch32_sam_224`) models. - -### July 5, 2021 * Add 'Aggregating Nested Transformer' (NesT) w/ weights converted from official [Flax impl](https://github.com/google-research/nested-transformer). Contributed by [Alexander Soare](https://github.com/alexander-soare). + * `jx_nest_base` - 83.534, `jx_nest_small` - 83.120, `jx_nest_tiny` - 81.426 ### June 23, 2021 * Reproduce gMLP model training, `gmlp_s16_224` trained to 79.6 top-1, matching [paper](https://arxiv.org/abs/2105.08050). Hparams for this and other recent MLP training [here](https://gist.github.com/rwightman/d6c264a9001f9167e06c209f630b2cc6) diff --git a/timm/models/byobnet.py b/timm/models/byobnet.py index 38ff6615..4c891ea5 100644 --- a/timm/models/byobnet.py +++ b/timm/models/byobnet.py @@ -101,6 +101,8 @@ default_cfgs = { 'gcresnext26ts': _cfg( first_conv='stem.conv1.conv', input_size=(3, 256, 256), pool_size=(8, 8), interpolation='bicubic'), + 'gcresnet26ts': _cfg( + first_conv='stem.conv1.conv', input_size=(3, 256, 256), pool_size=(8, 8), interpolation='bicubic'), 'bat_resnext26ts': _cfg( first_conv='stem.conv1.conv', input_size=(3, 256, 256), pool_size=(8, 8), interpolation='bicubic', min_input_size=(3, 256, 256)), @@ -329,6 +331,21 @@ model_cfgs = dict( attn_layer='gc', ), + gcresnet26ts=ByoModelCfg( + blocks=( + ByoBlockCfg(type='bottle', d=2, c=256, s=1, gs=0, br=0.25), + ByoBlockCfg(type='bottle', d=3, c=512, s=2, gs=0, br=0.25), + ByoBlockCfg(type='bottle', d=3, c=1536, s=2, gs=0, br=0.25), + ByoBlockCfg(type='bottle', d=2, c=1536, s=2, gs=0, br=0.25), + ), + stem_chs=64, + stem_type='tiered', + stem_pool='', + num_features=1280, + act_layer='silu', + attn_layer='gc', + ), + bat_resnext26ts=ByoModelCfg( blocks=( ByoBlockCfg(type='bottle', d=2, c=256, s=1, gs=32, br=0.25), @@ -470,6 +487,13 @@ def gcresnext26ts(pretrained=False, **kwargs): return _create_byobnet('gcresnext26ts', pretrained=pretrained, **kwargs) +@register_model +def gcresnet26ts(pretrained=False, **kwargs): + """ + """ + return _create_byobnet('gcresnet26ts', pretrained=pretrained, **kwargs) + + @register_model def bat_resnext26ts(pretrained=False, **kwargs): """ diff --git a/timm/models/efficientnet.py b/timm/models/efficientnet.py index 6426b540..1baf9d91 100644 --- a/timm/models/efficientnet.py +++ b/timm/models/efficientnet.py @@ -165,6 +165,12 @@ default_cfgs = { url='https://imvl-automl-sh.oss-cn-shanghai.aliyuncs.com/darts/hyperml/hyperml/job_45403/outputs/effnetb3_pruned_5abcc29f.pth', input_size=(3, 300, 300), pool_size=(10, 10), crop_pct=0.904, mean=IMAGENET_INCEPTION_MEAN, std=IMAGENET_INCEPTION_STD), + 'efficientnetv2_rw_t': _cfg( + url='https://github.com/rwightman/pytorch-image-models/releases/download/v0.1-weights/efficientnetv2_t_agc-3620981a.pth', + input_size=(3, 224, 224), test_input_size=(3, 288, 288), pool_size=(7, 7), crop_pct=1.0), + 'gc_efficientnetv2_rw_t': _cfg( + url='', + input_size=(3, 224, 224), test_input_size=(3, 288, 288), pool_size=(7, 7), crop_pct=1.0), 'efficientnetv2_rw_s': _cfg( url='https://github.com/rwightman/pytorch-image-models/releases/download/v0.1-weights/efficientnet_v2s_ra2_288-a6477665.pth', input_size=(3, 288, 288), test_input_size=(3, 384, 384), pool_size=(9, 9), crop_pct=1.0), @@ -1487,9 +1493,26 @@ def efficientnet_b3_pruned(pretrained=False, **kwargs): return model +@register_model +def efficientnetv2_rw_t(pretrained=False, **kwargs): + """ EfficientNet-V2 Tiny (Custom variant, tiny not in paper). """ + model = _gen_efficientnetv2_s( + 'efficientnetv2_rw_t', channel_multiplier=0.8, depth_multiplier=0.9, rw=False, pretrained=pretrained, **kwargs) + return model + + +@register_model +def gc_efficientnetv2_rw_t(pretrained=False, **kwargs): + """ EfficientNet-V2 Tiny w/ Global Context Attn (Custom variant, tiny not in paper). """ + model = _gen_efficientnetv2_s( + 'gc_efficientnetv2_t', channel_multiplier=0.8, depth_multiplier=0.9, + rw=False, se_layer='gc', pretrained=pretrained, **kwargs) + return model + + @register_model def efficientnetv2_rw_s(pretrained=False, **kwargs): - """ EfficientNet-V2 Small RW variant. + """ EfficientNet-V2 Small (RW variant). NOTE: This is my initial (pre official code release) w/ some differences. See efficientnetv2_s and tf_efficientnetv2_s for versions that match the official w/ PyTorch vs TF padding """ @@ -1499,7 +1522,7 @@ def efficientnetv2_rw_s(pretrained=False, **kwargs): @register_model def efficientnetv2_rw_m(pretrained=False, **kwargs): - """ EfficientNet-V2 Medium RW variant. + """ EfficientNet-V2 Medium (RW variant). """ model = _gen_efficientnetv2_s( 'efficientnetv2_rw_m', channel_multiplier=1.2, depth_multiplier=(1.2,) * 4 + (1.6,) * 2, rw=True, diff --git a/timm/version.py b/timm/version.py index 94c48197..779b9fc3 100644 --- a/timm/version.py +++ b/timm/version.py @@ -1 +1 @@ -__version__ = '0.4.12' +__version__ = '0.4.13'