{"id":13486263,"url":"https://github.com/SwinTransformer/Swin-Transformer-Semantic-Segmentation","last_synced_at":"2025-03-27T20:32:36.666Z","repository":{"id":40679754,"uuid":"357188922","full_name":"SwinTransformer/Swin-Transformer-Semantic-Segmentation","owner":"SwinTransformer","description":"This is an official implementation for \"Swin Transformer: Hierarchical Vision Transformer using Shifted Windows\" on Semantic Segmentation.","archived":false,"fork":true,"pushed_at":"2022-08-24T09:40:20.000Z","size":3815,"stargazers_count":1157,"open_issues_count":61,"forks_count":223,"subscribers_count":12,"default_branch":"main","last_synced_at":"2024-10-01T21:01:46.517Z","etag":null,"topics":["ade20k","semantic-segmentation","swin-transformer","upernet"],"latest_commit_sha":null,"homepage":"https://arxiv.org/abs/2103.14030","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"open-mmlab/mmsegmentation","license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SwinTransformer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-04-12T12:41:04.000Z","updated_at":"2024-09-29T14:25:13.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/SwinTransformer/Swin-Transformer-Semantic-Segmentation","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SwinTransformer%2FSwin-Transformer-Semantic-Segmentation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SwinTransformer%2FSwin-Transformer-Semantic-Segmentation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SwinTransformer%2FSwin-Transformer-Semantic-Segmentation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SwinTransformer%2FSwin-Transformer-Semantic-Segmentation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SwinTransformer","download_url":"https://codeload.github.com/SwinTransformer/Swin-Transformer-Semantic-Segmentation/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222313874,"owners_count":16965402,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ade20k","semantic-segmentation","swin-transformer","upernet"],"created_at":"2024-07-31T18:00:42.796Z","updated_at":"2024-10-30T21:31:21.477Z","avatar_url":"https://github.com/SwinTransformer.png","language":"Python","funding_links":[],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"readme":"# Swin Transformer for Semantic Segmentaion\n\nThis repo contains the supported code and configuration files to reproduce semantic segmentaion results of [Swin Transformer](https://arxiv.org/pdf/2103.14030.pdf). It is based on [mmsegmentaion](https://github.com/open-mmlab/mmsegmentation/tree/v0.11.0).\n\n## Updates\n\n***05/11/2021*** Models for [MoBY](https://github.com/SwinTransformer/Transformer-SSL) are released\n\n***04/12/2021*** Initial commits\n\n## Results and Models\n\n### ADE20K\n\n| Backbone | Method | Crop Size | Lr Schd | mIoU | mIoU (ms+flip) | #params | FLOPs | config | log | model |\n| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |\n| Swin-T | UPerNet | 512x512 | 160K | 44.51 | 45.81 | 60M | 945G | [config](configs/swin/upernet_swin_tiny_patch4_window7_512x512_160k_ade20k.py) | [github](https://github.com/SwinTransformer/storage/releases/download/v1.0.1/upernet_swin_tiny_patch4_window7_512x512.log.json)/[baidu](https://pan.baidu.com/s/1dq0DdS17dFcmAzHlM_1rgw) | [github](https://github.com/SwinTransformer/storage/releases/download/v1.0.1/upernet_swin_tiny_patch4_window7_512x512.pth)/[baidu](https://pan.baidu.com/s/17VmmppX-PUKuek9T5H3Iqw) |\n| Swin-S | UperNet | 512x512 | 160K | 47.64 | 49.47 | 81M | 1038G | [config](configs/swin/upernet_swin_small_patch4_window7_512x512_160k_ade20k.py) | [github](https://github.com/SwinTransformer/storage/releases/download/v1.0.1/upernet_swin_small_patch4_window7_512x512.log.json)/[baidu](https://pan.baidu.com/s/1ko3SVKPzH9x5B7SWCFxlig) | [github](https://github.com/SwinTransformer/storage/releases/download/v1.0.1/upernet_swin_small_patch4_window7_512x512.pth)/[baidu](https://pan.baidu.com/s/184em63etTMsf0cR_NX9zNg) |\n| Swin-B | UperNet | 512x512 | 160K | 48.13 | 49.72 | 121M | 1188G | [config](configs/swin/upernet_swin_base_patch4_window7_512x512_160k_ade20k.py) | [github](https://github.com/SwinTransformer/storage/releases/download/v1.0.1/upernet_swin_base_patch4_window7_512x512.log.json)/[baidu](https://pan.baidu.com/s/1YlXXiB3GwUKhHobUajlIaQ) | [github](https://github.com/SwinTransformer/storage/releases/download/v1.0.1/upernet_swin_base_patch4_window7_512x512.pth)/[baidu](https://pan.baidu.com/s/12B2dY_niMirwtu64_9AMbg) |\n\n**Notes**: \n\n- **Pre-trained models can be downloaded from [Swin Transformer for ImageNet Classification](https://github.com/microsoft/Swin-Transformer)**.\n- Access code for `baidu` is `swin`.\n\n## Results of MoBY with Swin Transformer\n\n### ADE20K\n\n| Backbone | Method | Crop Size | Lr Schd | mIoU | mIoU (ms+flip) | #params | FLOPs | config | log | model |\n| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |\n| Swin-T | UPerNet | 512x512 | 160K | 44.06 | 45.58 | 60M | 945G | [config](configs/swin/upernet_swin_tiny_patch4_window7_512x512_160k_ade20k.py) | [github](https://github.com/SwinTransformer/storage/releases/download/v1.0.3/moby_upernet_swin_tiny_patch4_window7_512x512.log.json)/[baidu](https://pan.baidu.com/s/1i0EMiapoQ-otkDmx-_cJHg) | [github](https://github.com/SwinTransformer/storage/releases/download/v1.0.3/moby_upernet_swin_tiny_patch4_window7_512x512.pth)/[baidu](https://pan.baidu.com/s/1BYgtgkHQV89bGC7LQLS7Jw) |\n\n**Notes**:\n\n- The learning rate needs to be tuned for best practice.\n- MoBY pre-trained models can be downloaded from [MoBY with Swin Transformer](https://github.com/SwinTransformer/Transformer-SSL).\n\n## Usage\n\n### Installation\n\nPlease refer to [get_started.md](https://github.com/open-mmlab/mmsegmentation/blob/master/docs/get_started.md#installation) for installation and dataset preparation.\n\n### Inference\n```\n# single-gpu testing\npython tools/test.py \u003cCONFIG_FILE\u003e \u003cSEG_CHECKPOINT_FILE\u003e --eval mIoU\n\n# multi-gpu testing\ntools/dist_test.sh \u003cCONFIG_FILE\u003e \u003cSEG_CHECKPOINT_FILE\u003e \u003cGPU_NUM\u003e --eval mIoU\n\n# multi-gpu, multi-scale testing\ntools/dist_test.sh \u003cCONFIG_FILE\u003e \u003cSEG_CHECKPOINT_FILE\u003e \u003cGPU_NUM\u003e --aug-test --eval mIoU\n```\n\n### Training\n\nTo train with pre-trained models, run:\n```\n# single-gpu training\npython tools/train.py \u003cCONFIG_FILE\u003e --options model.pretrained=\u003cPRETRAIN_MODEL\u003e [model.backbone.use_checkpoint=True] [other optional arguments]\n\n# multi-gpu training\ntools/dist_train.sh \u003cCONFIG_FILE\u003e \u003cGPU_NUM\u003e --options model.pretrained=\u003cPRETRAIN_MODEL\u003e [model.backbone.use_checkpoint=True] [other optional arguments] \n```\nFor example, to train an UPerNet model with a `Swin-T` backbone and 8 gpus, run:\n```\ntools/dist_train.sh configs/swin/upernet_swin_tiny_patch4_window7_512x512_160k_ade20k.py 8 --options model.pretrained=\u003cPRETRAIN_MODEL\u003e \n```\n\n**Notes:** \n- `use_checkpoint` is used to save GPU memory. Please refer to [this page](https://pytorch.org/docs/stable/checkpoint.html) for more details.\n- The default learning rate and training schedule is for 8 GPUs and 2 imgs/gpu.\n\n\n## Citing Swin Transformer\n```\n@article{liu2021Swin,\n  title={Swin Transformer: Hierarchical Vision Transformer using Shifted Windows},\n  author={Liu, Ze and Lin, Yutong and Cao, Yue and Hu, Han and Wei, Yixuan and Zhang, Zheng and Lin, Stephen and Guo, Baining},\n  journal={arXiv preprint arXiv:2103.14030},\n  year={2021}\n}\n```\n\n## Other Links\n\n\u003e **Image Classification**: See [Swin Transformer for Image Classification](https://github.com/microsoft/Swin-Transformer).\n\n\u003e **Object Detection**: See [Swin Transformer for Object Detection](https://github.com/SwinTransformer/Swin-Transformer-Object-Detection).\n\n\u003e **Self-Supervised Learning**: See [MoBY with Swin Transformer](https://github.com/SwinTransformer/Transformer-SSL).\n\n\u003e **Video Recognition**, See [Video Swin Transformer](https://github.com/SwinTransformer/Video-Swin-Transformer).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSwinTransformer%2FSwin-Transformer-Semantic-Segmentation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSwinTransformer%2FSwin-Transformer-Semantic-Segmentation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSwinTransformer%2FSwin-Transformer-Semantic-Segmentation/lists"}