Home

Awesome

AS-MLP for Semantic Segmentaion

This repo contains the supported code and configuration files to reproduce semantic segmentaion results of AS-MLP. It is based on Swin Transformer.

Results and Models

ADE20K

BackboneMethodCrop SizeLr SchdmIoU (ms+flip)ParamsFLOPsconfigmodel
AS-MLP-TUPerNet512x512160K46.560M937Gconfig
AS-MLP-SUperNet512x512160K49.281M1024Gconfig
AS-MLP-BUperNet512x512160K49.5121M1166Gconfigonedrive

Notes:

Results of MoBY with Swin Transformer

Usage

Installation

Please refer to get_started.md for installation and dataset preparation.

Inference

# single-gpu testing
python tools/test.py <CONFIG_FILE> <SEG_CHECKPOINT_FILE> --eval mIoU

# multi-gpu testing
tools/dist_test.sh <CONFIG_FILE> <SEG_CHECKPOINT_FILE> <GPU_NUM> --eval mIoU

# multi-gpu, multi-scale testing
tools/dist_test.sh <CONFIG_FILE> <SEG_CHECKPOINT_FILE> <GPU_NUM> --aug-test --eval mIoU

Training

To train with pre-trained models, run:

# single-gpu training
python tools/train.py <CONFIG_FILE> --options model.pretrained=<PRETRAIN_MODEL> [model.backbone.use_checkpoint=True] [other optional arguments]

# multi-gpu training
tools/dist_train.sh <CONFIG_FILE> <GPU_NUM> --options model.pretrained=<PRETRAIN_MODEL> [model.backbone.use_checkpoint=True] [other optional arguments] 

For example, to train an UPerNet model with a AS-MLP-T backbone and 8 gpus, run:

tools/dist_train.sh configs/asmlp/upernet_asmlp_tiny_patch4_shift5_512x512_160k_ade20k.py 8 --options model.pretrained=<PRETRAIN_MODEL> 

Notes:

Citation

@article{Lian_2021_ASMLP,
  author = {Lian, Dongze and Yu, Zehao and Sun, Xing and Gao, Shenghua},
  title = {AS-MLP: An Axial Shifted MLP Architecture for Vision},
  journal={ICLR},
  year = {2022}
}

Other Links

Image Classification: See AS-MLP for Image Classification.

Object Detection: See AS-MLP for Object Detection.