From c5a8e929fb746dc1ff85bee980b41ce3eb24f600 Mon Sep 17 00:00:00 2001 From: Ross Wightman Date: Sun, 3 Apr 2022 15:22:55 -0700 Subject: [PATCH] Add initial swinv2 tiny / small weights --- timm/models/helpers.py | 5 ----- timm/models/swin_transformer.py | 1 - timm/models/swin_transformer_v2_cr.py | 7 ++++--- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/timm/models/helpers.py b/timm/models/helpers.py index bbedd7a8..c4f48d6a 100644 --- a/timm/models/helpers.py +++ b/timm/models/helpers.py @@ -172,11 +172,6 @@ def load_custom_pretrained( pretrained_cfg (dict): Default pretrained model cfg load_fn: An external stand alone fn that loads weights into provided model, otherwise a fn named 'laod_pretrained' on the model will be called if it exists - progress (bool, optional): whether or not to display a progress bar to stderr. Default: False - check_hash(bool, optional): If True, the filename part of the URL should follow the naming convention - ``filename-.ext`` where ```` is the first eight or more - digits of the SHA256 hash of the contents of the file. The hash is used to - ensure unique names and to verify the contents of the file. Default: False """ pretrained_cfg = pretrained_cfg or getattr(model, 'pretrained_cfg', None) or {} load_from, pretrained_loc = _resolve_pretrained_source(pretrained_cfg) diff --git a/timm/models/swin_transformer.py b/timm/models/swin_transformer.py index ef87dc88..5b509a48 100644 --- a/timm/models/swin_transformer.py +++ b/timm/models/swin_transformer.py @@ -46,7 +46,6 @@ def _cfg(url='', **kwargs): default_cfgs = { - # patch models (my experiments) 'swin_base_patch4_window12_384': _cfg( url='https://github.com/SwinTransformer/storage/releases/download/v1.0.0/swin_base_patch4_window12_384_22kto1k.pth', input_size=(3, 384, 384), crop_pct=1.0), diff --git a/timm/models/swin_transformer_v2_cr.py b/timm/models/swin_transformer_v2_cr.py index 8ad5eb04..bb8fe3cc 100644 --- a/timm/models/swin_transformer_v2_cr.py +++ b/timm/models/swin_transformer_v2_cr.py @@ -64,17 +64,18 @@ def _cfg(url='', **kwargs): default_cfgs = { - # patch models (my experiments) 'swin_v2_cr_tiny_384': _cfg( url="", input_size=(3, 384, 384), crop_pct=1.0), 'swin_v2_cr_tiny_224': _cfg( url="", input_size=(3, 224, 224), crop_pct=0.9), 'swin_v2_cr_tiny_ns_224': _cfg( - url="", input_size=(3, 224, 224), crop_pct=0.9), + url="https://github.com/rwightman/pytorch-image-models/releases/download/v0.1-weights-swinv2/swin_v2_cr_tiny_ns_224-ba8166c6.pth", + input_size=(3, 224, 224), crop_pct=0.9), 'swin_v2_cr_small_384': _cfg( url="", input_size=(3, 384, 384), crop_pct=1.0), 'swin_v2_cr_small_224': _cfg( - url="", input_size=(3, 224, 224), crop_pct=0.9), + url="https://github.com/rwightman/pytorch-image-models/releases/download/v0.1-weights-swinv2/swin_v2_cr_small_224-0813c165.pth", + input_size=(3, 224, 224), crop_pct=0.9), 'swin_v2_cr_base_384': _cfg( url="", input_size=(3, 384, 384), crop_pct=1.0), 'swin_v2_cr_base_224': _cfg(