feat: add stdc kn configs
This commit is contained in:
parent
6b27600a1a
commit
57bb510d5e
54
configs/_base_/datasets/kn_cityscapes.py
Normal file
54
configs/_base_/datasets/kn_cityscapes.py
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
# dataset settings
|
||||||
|
dataset_type = 'CityscapesDataset'
|
||||||
|
data_root = 'data/cityscapes/'
|
||||||
|
img_norm_cfg = dict(
|
||||||
|
mean=[128., 128., 128.], std=[256., 256., 256.], to_rgb=True)
|
||||||
|
crop_size = (512, 1024)
|
||||||
|
train_pipeline = [
|
||||||
|
dict(type='LoadImageFromFile'),
|
||||||
|
dict(type='LoadAnnotations'),
|
||||||
|
dict(type='Resize', img_scale=(2048, 1024), ratio_range=(0.5, 2.0)),
|
||||||
|
dict(type='RandomCrop', crop_size=crop_size, cat_max_ratio=0.75),
|
||||||
|
dict(type='RandomFlip', prob=0.5),
|
||||||
|
dict(type='PhotoMetricDistortion'),
|
||||||
|
dict(type='Normalize', **img_norm_cfg),
|
||||||
|
dict(type='Pad', size=crop_size, pad_val=0, seg_pad_val=255),
|
||||||
|
dict(type='DefaultFormatBundle'),
|
||||||
|
dict(type='Collect', keys=['img', 'gt_semantic_seg']),
|
||||||
|
]
|
||||||
|
test_pipeline = [
|
||||||
|
dict(type='LoadImageFromFile'),
|
||||||
|
dict(
|
||||||
|
type='MultiScaleFlipAug',
|
||||||
|
# img_scale=(2048, 1024),
|
||||||
|
img_scale=(1024, 512),
|
||||||
|
flip=False,
|
||||||
|
transforms=[
|
||||||
|
dict(type='Resize', keep_ratio=True),
|
||||||
|
dict(type='RandomFlip'),
|
||||||
|
dict(type='Normalize', **img_norm_cfg),
|
||||||
|
dict(type='ImageToTensor', keys=['img']),
|
||||||
|
dict(type='Collect', keys=['img']),
|
||||||
|
])
|
||||||
|
]
|
||||||
|
data = dict(
|
||||||
|
samples_per_gpu=2,
|
||||||
|
workers_per_gpu=2,
|
||||||
|
train=dict(
|
||||||
|
type=dataset_type,
|
||||||
|
data_root=data_root,
|
||||||
|
img_dir='leftImg8bit/train',
|
||||||
|
ann_dir='gtFine/train',
|
||||||
|
pipeline=train_pipeline),
|
||||||
|
val=dict(
|
||||||
|
type=dataset_type,
|
||||||
|
data_root=data_root,
|
||||||
|
img_dir='leftImg8bit/val',
|
||||||
|
ann_dir='gtFine/val',
|
||||||
|
pipeline=test_pipeline),
|
||||||
|
test=dict(
|
||||||
|
type=dataset_type,
|
||||||
|
data_root=data_root,
|
||||||
|
img_dir='leftImg8bit/val',
|
||||||
|
ann_dir='gtFine/val',
|
||||||
|
pipeline=test_pipeline))
|
||||||
14
configs/stdc/kn_stdc1_in1k-pre_512x1024_80k_cityscapes.py
Normal file
14
configs/stdc/kn_stdc1_in1k-pre_512x1024_80k_cityscapes.py
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
checkpoint = 'https://download.openmmlab.com/mmsegmentation/v0.5/pretrain/stdc/stdc1_20220308-5368626c.pth' # noqa
|
||||||
|
_base_ = [
|
||||||
|
'../_base_/models/stdc.py', '../_base_/datasets/kn_cityscapes.py',
|
||||||
|
'../_base_/default_runtime.py', '../_base_/schedules/schedule_80k.py'
|
||||||
|
]
|
||||||
|
lr_config = dict(warmup='linear', warmup_iters=1000)
|
||||||
|
data = dict(
|
||||||
|
samples_per_gpu=12,
|
||||||
|
workers_per_gpu=4,
|
||||||
|
)
|
||||||
|
model = dict(
|
||||||
|
backbone=dict(
|
||||||
|
backbone_cfg=dict(
|
||||||
|
init_cfg=dict(type='Pretrained', checkpoint=checkpoint))))
|
||||||
Loading…
x
Reference in New Issue
Block a user