mmsegmentation/configs/swin
谢昕辰 c11da07e18
[Enhancement] Delete convert function and add instruction to ViT/Swin README.md (#791)
* delete convert function and add instruction to README.md

* unified model convert and README

* remove url

* fix import error

* fix unittest

* rename pretrain

* rename vit and deit pretrain

* Update upernet_deit-b16_512x512_160k_ade20k.py

* Update upernet_deit-b16_512x512_80k_ade20k.py

* Update upernet_deit-b16_ln_mln_512x512_160k_ade20k.py

* Update upernet_deit-b16_mln_512x512_160k_ade20k.py

* Update upernet_deit-s16_512x512_160k_ade20k.py

* Update upernet_deit-s16_512x512_80k_ade20k.py

* Update upernet_deit-s16_ln_mln_512x512_160k_ade20k.py

* Update upernet_deit-s16_mln_512x512_160k_ade20k.py

Co-authored-by: Jiarui XU <xvjiarui0826@gmail.com>
Co-authored-by: Junjun2016 <hejunjun@sjtu.edu.cn>
2021-08-25 15:00:41 -07:00
..
README.md [Enhancement] Delete convert function and add instruction to ViT/Swin README.md (#791) 2021-08-25 15:00:41 -07:00
swin.yml Fix random behavior of update_model_index in pre-commit hook (#784) 2021-08-15 23:33:08 +08:00
upernet_swin_base_patch4_window7_512x512_160k_ade20k_pretrain_224x224_1K.py [Enhancement] Delete convert function and add instruction to ViT/Swin README.md (#791) 2021-08-25 15:00:41 -07:00
upernet_swin_base_patch4_window7_512x512_160k_ade20k_pretrain_224x224_22K.py [Enhancement] Delete convert function and add instruction to ViT/Swin README.md (#791) 2021-08-25 15:00:41 -07:00
upernet_swin_base_patch4_window12_512x512_160k_ade20k_pretrain_384x384_1K.py [Enhancement] Delete convert function and add instruction to ViT/Swin README.md (#791) 2021-08-25 15:00:41 -07:00
upernet_swin_base_patch4_window12_512x512_160k_ade20k_pretrain_384x384_22K.py [Enhancement] Delete convert function and add instruction to ViT/Swin README.md (#791) 2021-08-25 15:00:41 -07:00
upernet_swin_small_patch4_window7_512x512_160k_ade20k_pretrain_224x224_1K.py [Enhancement] Delete convert function and add instruction to ViT/Swin README.md (#791) 2021-08-25 15:00:41 -07:00
upernet_swin_tiny_patch4_window7_512x512_160k_ade20k_pretrain_224x224_1K.py [Enhancement] Delete convert function and add instruction to ViT/Swin README.md (#791) 2021-08-25 15:00:41 -07:00

README.md

Swin Transformer: Hierarchical Vision Transformer using Shifted Windows

Introduction

@article{liu2021Swin,
  title={Swin Transformer: Hierarchical Vision Transformer using Shifted Windows},
  author={Liu, Ze and Lin, Yutong and Cao, Yue and Hu, Han and Wei, Yixuan and Zhang, Zheng and Lin, Stephen and Guo, Baining},
  journal={arXiv preprint arXiv:2103.14030},
  year={2021}
}

Usage

To use other repositories' pre-trained models, it is necessary to convert keys.

We provide a script swin2mmseg.py in the tools directory to convert the key of models from the official repo to MMSegmentation style.

python tools/model_converters/swin2mmseg.py ${PRETRAIN_PATH} ${STORE_PATH}

E.g.

python tools/model_converters/swin2mmseg.py https://github.com/SwinTransformer/storage/releases/download/v1.0.0/swin_base_patch4_window7_224.pth pretrain/swin_base_patch4_window7_224.pth

This script convert model from PRETRAIN_PATH and store the converted model in STORE_PATH.

Results and models

ADE20K

Method Backbone Crop Size pretrain pretrain img size Batch Size Lr schd Mem (GB) Inf time (fps) mIoU mIoU(ms+flip) config download
UperNet Swin-T 512x512 ImageNet-1K 224x224 16 160000 5.02 21.06 44.41 45.79 config model | log
UperNet Swin-S 512x512 ImageNet-1K 224x224 16 160000 6.17 14.72 47.72 49.24 config model | log
UperNet Swin-B 512x512 ImageNet-1K 224x224 16 160000 7.61 12.65 47.99 49.57 config model | log
UperNet Swin-B 512x512 ImageNet-22K 224x224 16 160000 - - 50.31 51.9 config model | log
UperNet Swin-B 512x512 ImageNet-1K 384x384 16 160000 8.52 12.10 48.35 49.65 config model | log
UperNet Swin-B 512x512 ImageNet-22K 384x384 16 160000 - - 50.76 52.4 config model | log