-
Notifications
You must be signed in to change notification settings - Fork 78
/
changer_ex_s50_512x512_40k_levircd.py
43 lines (38 loc) · 1.37 KB
/
changer_ex_s50_512x512_40k_levircd.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
_base_ = [
'../_base_/models/changer_s50.py',
'../common/standard_512x512_40k_levircd.py']
crop_size = (512, 512)
model = dict(
backbone=dict(
interaction_cfg=(
None,
dict(type='SpatialExchange', p=1/2),
dict(type='ChannelExchange', p=1/2),
dict(type='ChannelExchange', p=1/2))
),
decode_head=dict(
num_classes=2,
sampler=dict(type='mmseg.OHEMPixelSampler', thresh=0.7, min_kept=100000)),
# test_cfg=dict(mode='slide', crop_size=crop_size, stride=(crop_size[0]//2, crop_size[1]//2)),
)
train_pipeline = [
dict(type='MultiImgLoadImageFromFile'),
dict(type='MultiImgLoadAnnotations'),
dict(type='MultiImgRandomRotFlip', rotate_prob=0.5, flip_prob=0.5, degree=(-20, 20)),
dict(type='MultiImgRandomCrop', crop_size=crop_size, cat_max_ratio=0.75),
dict(type='MultiImgExchangeTime', prob=0.5),
dict(
type='MultiImgPhotoMetricDistortion',
brightness_delta=10,
contrast_range=(0.8, 1.2),
saturation_range=(0.8, 1.2),
hue_delta=10),
dict(type='MultiImgPackSegInputs')
]
train_dataloader = dict(
dataset=dict(pipeline=train_pipeline))
# optimizer
optimizer=dict(
type='AdamW', lr=0.005, betas=(0.9, 0.999), weight_decay=0.05)
optim_wrapper = dict(type='OptimWrapper', optimizer=optimizer)
# compile = True # use PyTorch 2.x