-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtrain_SRResNet_x4_FFHQ_300k.yml
More file actions
158 lines (134 loc) · 3.73 KB
/
Copy pathtrain_SRResNet_x4_FFHQ_300k.yml
File metadata and controls
158 lines (134 loc) · 3.73 KB
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
# Modified SRResNet w/o BN from:
# Photo-Realistic Single Image Super-Resolution Using a Generative Adversarial Network
# ----------- Commands for running
# ----------- Single GPU with auto_resume
# CUDA_VISIBLE_DEVICES=0 python realesrgan/train.py -opt options/train_SRResNet_x4_FFHQ_300k.yml --auto_resume
# general settings
name: train_SRResNet_x4_FFHQ_300k
model_type: RealESRNetModel
scale: 4
num_gpu: 1 # set num_gpu: 0 for cpu mode
manual_seed: 0
# ----------------- options for synthesizing training data in RealESRNetModel ----------------- #
gt_usm: True # USM the ground-truth
l1_gt_usm: true # use gt_usm as target for L1 loss
# the first degradation process
resize_prob: [0.2, 0.7, 0.1] # up, down, keep
resize_range: [0.2, 1.5]
gaussian_noise_prob: 0.5
noise_range: [1, 20]
poisson_scale_range: [0.05, 2]
gray_noise_prob: 0.4
jpeg_range: [50, 95]
# the second degradation process
second_blur_prob: 0.8
resize_prob2: [0.3, 0.4, 0.3] # up, down, keep
resize_range2: [0.3, 1.2]
gaussian_noise_prob2: 0.5
noise_range2: [1, 15]
poisson_scale_range2: [0.05, 1.5]
gray_noise_prob2: 0.4
jpeg_range2: [70, 95]
gt_size: 512
queue_size: 192 # divisible by batch size 24
# dataset and data loader settings
datasets:
train:
name: FFHQ_train
type: FFHQsubDataset
dataroot_gt: ../2024-S2-AI6126-Project2-Release/datasets/train/GT
meta_info: ../2024-S2-AI6126-Project2-Release/datasets/train/meta_info_FFHQ6000sub_GT.txt
io_backend:
type: disk
blur_kernel_size: 21
kernel_list: ['iso', 'aniso', 'generalized_iso', 'generalized_aniso', 'plateau_iso', 'plateau_aniso']
kernel_prob: [0.45, 0.25, 0.12, 0.03, 0.12, 0.03]
sinc_prob: 0.1
blur_sigma: [0.2, 3]
betag_range: [0.5, 4]
betap_range: [1, 2]
blur_kernel_size2: 21
kernel_list2: ['iso', 'aniso', 'generalized_iso', 'generalized_aniso', 'plateau_iso', 'plateau_aniso']
kernel_prob2: [0.45, 0.25, 0.12, 0.03, 0.12, 0.03]
sinc_prob2: 0.1
blur_sigma2: [0.2, 1.5]
betag_range2: [0.5, 4]
betap_range2: [1, 2]
final_sinc_prob: 0.8
gt_size: 512
use_hflip: True
use_rot: False
# data loader
use_shuffle: true
num_worker_per_gpu: 10 # earlier 6
batch_size_per_gpu: 24 # earlier 8
dataset_enlarge_ratio: 1
prefetch_mode: ~
val:
name: FFHQ_val
type: PairedImageDataset
dataroot_gt: ../2024-S2-AI6126-Project2-Release/datasets/val/GT
dataroot_lq: ../2024-S2-AI6126-Project2-Release/datasets/val/LQ
io_backend:
type: disk
# network structures
network_g:
type: MSRResNet
num_in_ch: 3
num_out_ch: 3
num_feat: 64
num_block: 26
upscale: 4
# path
path:
pretrain_network_g: ~
param_key_g: params
strict_load_g: true
resume_state: ~
# training settings
train:
ema_decay: 0.999
optim_g:
type: Adam
lr: !!float 1e-4
weight_decay: 0
betas: [0.9, 0.99]
scheduler:
type: CosineAnnealingRestartLR
periods: [30000, 30000, 30000, 30000, 30000]
restart_weights: [1, 1, 1, 1, 1]
eta_min: !!float 1e-7
total_iter: 150000 # 600 epochs
warmup_iter: -1 # no warm up
pixel_opt:
type: MSELoss
loss_weight: 1.0
reduction: mean
net_d_iters: 1
net_d_init_iters: 0
# validation settings
val:
val_freq: !!float 5e2
save_img: true
metrics:
psnr: # metric name, can be arbitrary
type: calculate_psnr
crop_border: 0
test_y_channel: false
better: higher # the higher, the better. Default: higher
niqe:
type: calculate_ssim
crop_border: 0
better: higher # the lower, the better
# logging settings
logger:
print_freq: 100
save_checkpoint_freq: !!float 5e3
use_tb_logger: true
wandb:
project: ~
resume_id: ~
# dist training settings
dist_params:
backend: nccl
port: 29500