62 lines
1.8 KiB
Python
62 lines
1.8 KiB
Python
_base_ = [
|
|
'../_base_/models/fast_scnn.py', '../_base_/datasets/cityscapes.py',
|
|
'../_base_/default_runtime.py'
|
|
]
|
|
crop_size = (512, 1024)
|
|
cudnn_benchmark = True
|
|
# model training and testing settings
|
|
train_cfg = dict()
|
|
test_cfg = dict(mode='whole')
|
|
|
|
# Here: What is parameter 'with_seg'?
|
|
img_norm_cfg = dict(
|
|
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
|
|
train_pipeline = [
|
|
dict(type='LoadImageFromFile', to_float32=True),
|
|
dict(type='LoadAnnotations'), # with_seg=True
|
|
dict(type='Resize', img_scale=(2048, 1024), ratio_range=(0.5, 2.0)),
|
|
dict(type='RandomFlip', flip_ratio=0.5),
|
|
dict(type='PhotoMetricDistortion'),
|
|
dict(type='Normalize', **img_norm_cfg),
|
|
dict(type='RandomCrop', crop_size=crop_size),
|
|
dict(type='DefaultFormatBundle'),
|
|
dict(type='Collect', keys=['img', 'gt_semantic_seg']),
|
|
]
|
|
test_pipeline = [
|
|
dict(type='LoadImageFromFile'),
|
|
dict(
|
|
type='MultiScaleFlipAug',
|
|
img_scale=(2048, 1024),
|
|
# img_ratios=[0.5, 0.75, 1.0, 1.25, 1.5, 1.75],
|
|
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=8,
|
|
workers_per_gpu=4,
|
|
train=dict(pipeline=train_pipeline),
|
|
val=dict(pipeline=test_pipeline),
|
|
test=dict(pipeline=test_pipeline))
|
|
|
|
# optimizer
|
|
optimizer = dict(type='SGD', lr=0.01, momentum=0.9, weight_decay=4e-5)
|
|
optimizer_config = dict()
|
|
# learning policy
|
|
lr_config = dict(
|
|
policy='poly',
|
|
power=0.9,
|
|
by_epoch=False,
|
|
)
|
|
# runtime settings
|
|
# total_epochs = 1000
|
|
total_iters = 100000
|
|
evaluation = dict(interval=2000, metric='mIoU')
|
|
checkpoint_config = dict(interval=2000)
|
|
|