From 97f49d163cca05a6d3b215b633e85d13549771cb Mon Sep 17 00:00:00 2001 From: Mehrdad Date: Wed, 17 Mar 2021 10:51:51 -0700 Subject: [PATCH] adding efficientnet_el, efficientnet_es_prunedefficientnet_es_pruned and efficientnet_el_pruned pretrained models to timm/models --- timm/models/efficientnet.py | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/timm/models/efficientnet.py b/timm/models/efficientnet.py index 4a89590b..bfe97a79 100644 --- a/timm/models/efficientnet.py +++ b/timm/models/efficientnet.py @@ -117,7 +117,14 @@ default_cfgs = { url='https://github.com/rwightman/pytorch-image-models/releases/download/v0.1-weights/efficientnet_em_ra2-66250f76.pth', input_size=(3, 240, 240), pool_size=(8, 8), crop_pct=0.882), 'efficientnet_el': _cfg( - url='', input_size=(3, 300, 300), pool_size=(10, 10), crop_pct=0.904), + url='https://github.com/DeGirum/pruned-models/releases/download/efficientnet_v1.0/efficientnet_el.pth', + input_size=(3, 300, 300), pool_size=(10, 10), crop_pct=0.904), + + 'efficientnet_es_pruned': _cfg( + url='https://github.com/DeGirum/pruned-models/releases/download/efficientnet_v1.0/efficientnet_es_pruned75.pth'), + 'efficientnet_el_pruned': _cfg( + url='https://github.com/DeGirum/pruned-models/releases/download/efficientnet_v1.0/efficientnet_el_pruned70.pth', + input_size=(3, 300, 300), pool_size=(10, 10), crop_pct=0.904), 'efficientnet_cc_b0_4e': _cfg(url=''), 'efficientnet_cc_b0_8e': _cfg(url=''), @@ -1113,6 +1120,12 @@ def efficientnet_es(pretrained=False, **kwargs): 'efficientnet_es', channel_multiplier=1.0, depth_multiplier=1.0, pretrained=pretrained, **kwargs) return model +@register_model +def efficientnet_es_pruned(pretrained=False, **kwargs): + """ EfficientNet-Edge Small Pruned. For more info: https://github.com/DeGirum/pruned-models/releases/tag/efficientnet_v1.0""" + model = _gen_efficientnet_edge( + 'efficientnet_es_pruned', channel_multiplier=1.0, depth_multiplier=1.0, pretrained=pretrained, **kwargs) + return model @register_model def efficientnet_em(pretrained=False, **kwargs): @@ -1129,6 +1142,12 @@ def efficientnet_el(pretrained=False, **kwargs): 'efficientnet_el', channel_multiplier=1.2, depth_multiplier=1.4, pretrained=pretrained, **kwargs) return model +@register_model +def efficientnet_el_pruned(pretrained=False, **kwargs): + """ EfficientNet-Edge-Large pruned. For more info: https://github.com/DeGirum/pruned-models/releases/tag/efficientnet_v1.0""" + model = _gen_efficientnet_edge( + 'efficientnet_el_pruned', channel_multiplier=1.2, depth_multiplier=1.4, pretrained=pretrained, **kwargs) + return model @register_model def efficientnet_cc_b0_4e(pretrained=False, **kwargs):