forked from open-mmlab/mmagic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
indexnet_mobv2-dimaug_1xb16-78k_comp1k.py
54 lines (47 loc) · 1.47 KB
/
indexnet_mobv2-dimaug_1xb16-78k_comp1k.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
_base_ = ['./indexnet_mobv2_1xb16-78k_comp1k.py']
experiment_name = 'indexnet_mobv2-dimaug_1xb16-78k_comp1k'
work_dir = f'./work_dirs/{experiment_name}'
save_dir = './work_dirs/'
# model settings
model = dict(
test_cfg=dict(
resize_method='pad',
resize_mode='reflect',
size_divisor=32,
))
# dataset settings
train_pipeline = [
dict(type='LoadImageFromFile', key='alpha', color_type='grayscale'),
dict(type='LoadImageFromFile', key='fg'),
dict(type='LoadImageFromFile', key='bg'),
dict(type='LoadImageFromFile', key='merged'),
dict(
type='CropAroundUnknown',
keys=['alpha', 'merged', 'fg', 'bg'],
crop_sizes=[320, 480, 640]),
dict(type='Flip', keys=['alpha', 'merged', 'fg', 'bg']),
dict(
type='Resize',
keys=['alpha', 'merged', 'fg', 'bg'],
scale=(320, 320),
keep_ratio=False),
dict(type='GenerateTrimap', kernel_size=(1, 30)),
dict(type='PackInputs'),
]
test_pipeline = [
dict(
type='LoadImageFromFile',
key='alpha',
color_type='grayscale',
save_original_img=True),
dict(
type='LoadImageFromFile',
key='trimap',
color_type='grayscale',
save_original_img=True),
dict(type='LoadImageFromFile', key='merged'),
dict(type='PackInputs'),
]
train_dataloader = dict(dataset=dict(pipeline=train_pipeline))
val_dataloader = dict(dataset=dict(pipeline=test_pipeline))
test_dataloader = val_dataloader