-
Notifications
You must be signed in to change notification settings - Fork 78
/
changer_ex_s50_512x512_80k_s2looking.py
55 lines (50 loc) · 1.66 KB
/
changer_ex_s50_512x512_80k_s2looking.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
44
45
46
47
48
49
50
51
52
53
54
55
_base_ = [
'../_base_/models/changer_s50.py',
'../common/standard_512x512_40k_s2looking.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))
# learning policy
param_scheduler = [
dict(
type='LinearLR', start_factor=1e-6, by_epoch=False, begin=0, end=1000),
dict(
type='PolyLR',
power=1.0,
begin=1000,
end=80000,
eta_min=0.0,
by_epoch=False,
)
]
# training schedule for 80k
train_cfg = dict(type='IterBasedTrainLoop', max_iters=80000, val_interval=8000)
default_hooks = dict(checkpoint=dict(type='CheckpointHook', interval=8000))
# compile = True # use PyTorch 2.x