forked from mrq/DL-Art-School
Misc changes
This commit is contained in:
parent
a946483f1c
commit
8a514b9645
|
@ -12,18 +12,18 @@ import data.util as data_util # noqa: E402
|
|||
|
||||
|
||||
def main():
|
||||
mode = 'pair' # single (one input folder) | pair (extract corresponding GT and LR pairs)
|
||||
mode = 'single' # single (one input folder) | pair (extract corresponding GT and LR pairs)
|
||||
opt = {}
|
||||
opt['n_thread'] = 20
|
||||
opt['compression_level'] = 3 # 3 is the default value in cv2
|
||||
# CV_IMWRITE_PNG_COMPRESSION from 0 to 9. A higher value means a smaller size and longer
|
||||
# compression time. If read raw images during training, use 0 for faster IO speed.
|
||||
if mode == 'single':
|
||||
opt['input_folder'] = '../../datasets/div2k/DIV2K_train_HR'
|
||||
opt['save_folder'] = '../../datasets/div2k/DIV2K800_sub'
|
||||
opt['crop_sz'] = 480 # the size of each sub-image
|
||||
opt['step'] = 240 # step of the sliding crop window
|
||||
opt['thres_sz'] = 48 # size threshold
|
||||
opt['input_folder'] = 'D:\\vix_cropped'
|
||||
opt['save_folder'] = 'D:\\vix_tiled'
|
||||
opt['crop_sz'] = 800 # the size of each sub-image
|
||||
opt['step'] = 640 # step of the sliding crop window
|
||||
opt['thres_sz'] = 200 # size threshold
|
||||
extract_signle(opt)
|
||||
elif mode == 'pair':
|
||||
GT_folder = '../../datasets/div2k/DIV2K_train_HR'
|
||||
|
|
|
@ -48,7 +48,7 @@ network_D:
|
|||
path:
|
||||
pretrain_model_G: ~
|
||||
pretrain_model_D: ~
|
||||
resume_state: ~
|
||||
resume_state: ../experiments/train_vix_corrupt/training_state/47000.state
|
||||
strict_load: true
|
||||
|
||||
#### training settings: learning rate scheme, loss
|
||||
|
@ -74,7 +74,7 @@ train:
|
|||
pixel_criterion: l2
|
||||
pixel_weight: !!float 1e-2
|
||||
feature_criterion: l1
|
||||
feature_weight: 1.0
|
||||
feature_weight: .5
|
||||
feature_weight_decay: .98
|
||||
feature_weight_decay_steps: 1000
|
||||
feature_weight_minimum: .5
|
||||
|
|
97
codes/options/train/train_vix_corrupt_tiled.yml
Normal file
97
codes/options/train/train_vix_corrupt_tiled.yml
Normal file
|
@ -0,0 +1,97 @@
|
|||
#### general settings
|
||||
name: train_vix_corrupt_tiled
|
||||
use_tb_logger: true
|
||||
model: corruptgan
|
||||
distortion: downsample
|
||||
scale: 1
|
||||
gpu_ids: [0]
|
||||
amp_opt_level: O0
|
||||
|
||||
#### datasets
|
||||
datasets:
|
||||
train:
|
||||
name: vix_corrupt
|
||||
mode: downsample
|
||||
dataroot_GT: H:\\vix\\lr
|
||||
dataroot_LQ: H:\\ultra_lq\\tiled\\lr
|
||||
mismatched_Data_OK: true
|
||||
use_shuffle: true
|
||||
n_workers: 14 # per GPU
|
||||
batch_size: 48
|
||||
target_size: 64
|
||||
use_flip: true
|
||||
use_rot: true
|
||||
doCrop: false
|
||||
color: RGB
|
||||
val:
|
||||
name: vix_val
|
||||
mode: downsample
|
||||
target_size: 64
|
||||
dataroot_GT: E:\\4k6k\\datasets\\vixen\\val
|
||||
dataroot_LQ: E:\\4k6k\\datasets\\vixen\\val
|
||||
|
||||
#### network structures
|
||||
network_G:
|
||||
which_model_G: ResGenV2
|
||||
nf: 192
|
||||
nb_denoiser: 20
|
||||
nb_upsampler: 0
|
||||
upscale_applications: 0
|
||||
inject_noise: False
|
||||
|
||||
network_D:
|
||||
which_model_D: discriminator_vgg_128
|
||||
in_nc: 3
|
||||
nf: 64
|
||||
|
||||
#### path
|
||||
path:
|
||||
pretrain_model_G: ~
|
||||
pretrain_model_D: ~
|
||||
resume_state: ../experiments/train_vix_corrupt_tiled/training_state/5000.state
|
||||
strict_load: true
|
||||
|
||||
#### training settings: learning rate scheme, loss
|
||||
train:
|
||||
lr_G: !!float 1e-4
|
||||
weight_decay_G: 0
|
||||
beta1_G: 0.9
|
||||
beta2_G: 0.99
|
||||
lr_D: !!float 1e-4
|
||||
weight_decay_D: 0
|
||||
beta1_D: 0.9
|
||||
beta2_D: 0.99
|
||||
D_noise_theta_init: .01
|
||||
D_noise_final_it: 20000
|
||||
D_noise_theta_floor: .005
|
||||
lr_scheme: MultiStepLR
|
||||
|
||||
niter: 400000
|
||||
warmup_iter: -1 # no warm up
|
||||
lr_steps: [15000, 50000, 100000, 200000]
|
||||
lr_gamma: 0.5
|
||||
|
||||
pixel_criterion: l2
|
||||
pixel_weight: !!float 1e-2
|
||||
feature_criterion: l1
|
||||
feature_weight: .9
|
||||
feature_weight_decay: .98
|
||||
feature_weight_decay_steps: 1000
|
||||
feature_weight_minimum: .5
|
||||
gan_type: ragan # gan | ragan
|
||||
gan_weight: .1
|
||||
mega_batch_factor: 2
|
||||
swapout_G_freq: 113
|
||||
swapout_D_freq: 223
|
||||
swapout_duration: 40
|
||||
|
||||
D_update_ratio: 1
|
||||
D_init_iters: -1
|
||||
|
||||
manual_seed: 10
|
||||
val_freq: !!float 5e2
|
||||
|
||||
#### logger
|
||||
logger:
|
||||
print_freq: 50
|
||||
save_checkpoint_freq: 500
|
|
@ -4,4 +4,6 @@ rm lr/*
|
|||
rm pix/*
|
||||
rm ref/*
|
||||
rm genlr/*
|
||||
rm genmr/*
|
||||
rm genmr/*
|
||||
rm lr_precorrupt/*
|
||||
rm ref/*
|
|
@ -30,7 +30,7 @@ def init_dist(backend='nccl', **kwargs):
|
|||
def main():
|
||||
#### options
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('-opt', type=str, help='Path to option YAML file.', default='options/train/train_vix_corrupt.yml')
|
||||
parser.add_argument('-opt', type=str, help='Path to option YAML file.', default='options/train/train_vix_corrupt_tiled.yml')
|
||||
parser.add_argument('--launcher', choices=['none', 'pytorch'], default='none',
|
||||
help='job launcher')
|
||||
parser.add_argument('--local_rank', type=int, default=0)
|
||||
|
|
Loading…
Reference in New Issue
Block a user