mirror of
https://github.com/open-mmlab/mmsegmentation.git
synced 2025-06-03 22:03:48 +08:00
* add DPT head * [fix] fix init error * use mmcv function * delete code * remove transpose clas * support NLC output shape * Delete post_process_layer.py * add unittest and docstring * rename variables * fix project error and add unittest * match dpt weights * add configs * fix vit pos_embed bug and dpt feature fusion bug * match vit output * fix gelu * minor change * update unitest * fix configs error * inference test * remove auxilary * use local pretrain * update training results * update yml * update fps and memory test * update doc * update readme * add yml * update doc * remove with_cp * update config * update docstring * remove dpt-l * add init_cfg and modify readme.md * Update dpt_vit-b16.py * zh-n README * use constructor instead of build function * prevent tensor being modified by ConvModule * fix unittest Co-authored-by: Junjun2016 <hejunjun@sjtu.edu.cn>
32 lines
1004 B
Python
32 lines
1004 B
Python
norm_cfg = dict(type='SyncBN', requires_grad=True)
|
|
model = dict(
|
|
type='EncoderDecoder',
|
|
pretrained='pretrain/vit-b16_p16_224-80ecf9dd.pth', # noqa
|
|
backbone=dict(
|
|
type='VisionTransformer',
|
|
img_size=224,
|
|
embed_dims=768,
|
|
num_layers=12,
|
|
num_heads=12,
|
|
out_indices=(2, 5, 8, 11),
|
|
final_norm=False,
|
|
with_cls_token=True,
|
|
output_cls_token=True),
|
|
decode_head=dict(
|
|
type='DPTHead',
|
|
in_channels=(768, 768, 768, 768),
|
|
channels=256,
|
|
embed_dims=768,
|
|
post_process_channels=[96, 192, 384, 768],
|
|
num_classes=150,
|
|
readout_type='project',
|
|
input_transform='multiple_select',
|
|
in_index=(0, 1, 2, 3),
|
|
norm_cfg=norm_cfg,
|
|
loss_decode=dict(
|
|
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0)),
|
|
auxiliary_head=None,
|
|
# model training and testing settings
|
|
train_cfg=dict(),
|
|
test_cfg=dict(mode='whole')) # yapf: disable
|