Skip to content

Commit

Permalink
support transformer backbone (open-mmlab#465)
Browse files Browse the repository at this point in the history
* vit backbone

* fix lint

* add docstrings and fix pretrained pos_embed dim not match prob

* add unittest for vit

* fix lint

* add vit based fcn configs

* fix import error

* support multiple resolution input images

* upsample pos_embed at init_weights

* support resize pos_embed at evaluation

* fix training errors

* add more unitest code for vit backbone

* unitest for uncovered code

* add norm_eval unittest

* refactor _pos_embeding

* minor change

* change var name

* rafactor init_weight

* load weights after resize

* ignore 'module' in pretrain checkpoint

* add with_cp

* add with_cp

Co-authored-by: Jiarui XU <xvjiarui0826@gmail.com>
  • Loading branch information
谢昕辰 and xvjiarui authored Apr 22, 2021
1 parent 0d99ff9 commit b379b5a
Show file tree
Hide file tree
Showing 3 changed files with 463 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mmseg/models/backbones/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
from .resnet import ResNet, ResNetV1c, ResNetV1d
from .resnext import ResNeXt
from .unet import UNet
from .vit import VisionTransformer

__all__ = [
'ResNet', 'ResNetV1c', 'ResNetV1d', 'ResNeXt', 'HRNet', 'FastSCNN',
'ResNeSt', 'MobileNetV2', 'UNet', 'CGNet', 'MobileNetV3'
'ResNeSt', 'MobileNetV2', 'UNet', 'CGNet', 'MobileNetV3',
'VisionTransformer'
]
Loading

0 comments on commit b379b5a

Please sign in to comment.