-
Notifications
You must be signed in to change notification settings - Fork 40
/
landscape1m.yaml
175 lines (166 loc) · 4.33 KB
/
landscape1m.yaml
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
pretrained_weight: ./landscape1m-segformer.pt
inference_args:
random_style: True
use_fixed_random_style: False
keep_original_size: True
image_save_iter: 5000
snapshot_save_epoch: 5
snapshot_save_iter: 30000
max_epoch: 400
logging_iter: 100
trainer:
type: imaginaire.trainers.spade
model_average_config:
enabled: True
beta: 0.9999
start_iteration: 1000
num_batch_norm_estimation_iterations: 30
amp_config:
enabled: True
gan_mode: hinge
gan_relativistic: False
perceptual_loss:
mode: 'vgg19'
layers: ['relu_1_1', 'relu_2_1', 'relu_3_1', 'relu_4_1', 'relu_5_1']
weights: [0.03125, 0.0625, 0.125, 0.25, 1.0]
fp16: True
loss_weight:
gan: 1.0
perceptual: 10.0
feature_matching: 10.0
kl: 0.05
init:
type: xavier
gain: 0.02
gen_opt:
type: adam
lr: 0.0001
adam_beta1: 0.
adam_beta2: 0.999
lr_policy:
iteration_mode: False
type: step
step_size: 400
gamma: 0.1
dis_opt:
type: adam
lr: 0.0004
adam_beta1: 0.
adam_beta2: 0.999
lr_policy:
iteration_mode: False
type: step
step_size: 400
gamma: 0.1
gen:
type: imaginaire.generators.spade
version: v20
output_multiplier: 0.5
image_channels: 3
num_labels: 184
style_dims: 256
num_filters: 128
kernel_size: 3
weight_norm_type: 'spectral'
use_posenc_in_input_layer: False
global_adaptive_norm_type: 'sync_batch'
activation_norm_params:
num_filters: 128
kernel_size: 5
separate_projection: True
activation_norm_type: 'sync_batch'
style_enc:
num_filters: 64
kernel_size: 3
dis:
type: imaginaire.discriminators.spade
kernel_size: 4
num_filters: 128
max_num_filters: 512
num_discriminators: 2
num_layers: 5
activation_norm_type: 'none'
weight_norm_type: 'spectral'
# Data options.
data:
type: imaginaire.datasets.paired_images
# How many data loading workers per GPU?
num_workers: 8
input_types:
- images:
ext: jpg
num_channels: 3
normalize: True
use_dont_care: False
- seg_maps:
ext: jpg
num_channels: 1
is_mask: True
normalize: False
full_data_ops: imaginaire.model_utils.label::make_one_hot, imaginaire.model_utils.label::concat_labels
use_dont_care: True
one_hot_num_classes:
seg_maps: 183
input_labels:
- seg_maps
# Which lmdb contains the ground truth image.
input_image:
- images
# Train dataset details.
train:
# Input LMDBs.
dataset_type: lmdb
roots:
- ./data/lhq_lmdb/train
# Batch size per GPU.
batch_size: 4
# Data augmentations to be performed in given order.
augmentations:
resize_smallest_side: 512
# Rotate in (-rotate, rotate) in degrees.
rotate: 0
# Scale image by factor \in [1, 1+random_scale_limit].
random_scale_limit: 0.2
# Horizontal flip?
horizontal_flip: True
# Crop size.
random_crop_h_w: 512, 512
# Train dataset details.
val:
dataset_type: lmdb
# Input LMDBs.
roots:
- ./data/lhq_lmdb/val
# Batch size per GPU.
batch_size: 4
# Data augmentations to be performed in given order.
augmentations:
# Crop size.
resize_h_w: 512, 512
test_data:
type: imaginaire.datasets.paired_images
num_workers: 8
input_types:
- seg_maps:
ext: jpg
num_channels: 1
is_mask: True
normalize: False
full_data_ops: imaginaire.model_utils.label::make_one_hot, imaginaire.model_utils.label::concat_labels
use_dont_care: True
one_hot_num_classes:
seg_maps: 183
input_labels:
- seg_maps
paired: True
# Validation dataset details.
test:
is_lmdb: True
roots:
- ./data/lhq_lmdb/val
# Batch size per GPU.
batch_size: 1
# If resize_h_w is not given, then it is assumed to be same as crop_h_w.
augmentations:
resize_h_w: 256, 256
horizontal_flip: False