Skip to content

Commit 4d34581

Browse files
authored
[Feature] Segformer backbone re-implementation (open-mmlab#594)
* [Feature]Segformer re-implementation * Using act_cfg and norm_cfg to control activation and normalization * Split this PR into several little PRs * Fix lint error * Remove SegFormerHead * parameters init refactor * 1. Refactor segformer backbone parameters init; 2. Remove rebundant functions and unit tests; * Remove rebundant codes * 1. Remove rebundant codes; 2. Modify module name; * Refactor the backbone of segformer using mmcv.cnn.bricks.transformer.py * Fix some code logic bugs. * Add mit_convert.py to match pretrain keys of segformer. * Resolve some comments. * 1. Add some assert to ensure right params; 2. Support flexible peconv position; * Add pe_index assert and fix unit test. * 1. Add doc string for MixVisionTransformer; 2. Add some unit tests for MixVisionTransformer; * Use hw_shape to pass shape of feature map. * 1. Fix doc string of MixVisionTransformer; 2. Simplify MixFFN; 3. Modify H, W to hw_shape; * Add more unit tests. * Add doc string for shape convertion functions. * Add some unit tests to improve code coverage. * Fix Segformer backbone pretrain weights match bug. * resolve the shape convertion functions doc string. * Add pad_to_patch_size arg. * Modify default value of pad_to_patch_size arg.
1 parent dff7a96 commit 4d34581

File tree

9 files changed

+578
-11
lines changed

9 files changed

+578
-11
lines changed

mmseg/models/backbones/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from .cgnet import CGNet
22
from .fast_scnn import FastSCNN
33
from .hrnet import HRNet
4+
from .mit import MixVisionTransformer
45
from .mobilenet_v2 import MobileNetV2
56
from .mobilenet_v3 import MobileNetV3
67
from .resnest import ResNeSt
@@ -13,5 +14,5 @@
1314
__all__ = [
1415
'ResNet', 'ResNetV1c', 'ResNetV1d', 'ResNeXt', 'HRNet', 'FastSCNN',
1516
'ResNeSt', 'MobileNetV2', 'UNet', 'CGNet', 'MobileNetV3',
16-
'VisionTransformer', 'SwinTransformer'
17+
'VisionTransformer', 'SwinTransformer', 'MixVisionTransformer'
1718
]

0 commit comments

Comments
 (0)