train_realesrnet_x2plus.yml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. # general settings
  2. name: train_RealESRNetx2plus_1000k_B12G4
  3. model_type: RealESRNetModel
  4. scale: 2
  5. num_gpu: auto # auto: can infer from your visible devices automatically. official: 4 GPUs
  6. manual_seed: 0
  7. # ----------------- options for synthesizing training data in RealESRNetModel ----------------- #
  8. gt_usm: True # USM the ground-truth
  9. # the first degradation process
  10. resize_prob: [0.2, 0.7, 0.1] # up, down, keep
  11. resize_range: [0.15, 1.5]
  12. gaussian_noise_prob: 0.5
  13. noise_range: [1, 30]
  14. poisson_scale_range: [0.05, 3]
  15. gray_noise_prob: 0.4
  16. jpeg_range: [30, 95]
  17. # the second degradation process
  18. second_blur_prob: 0.8
  19. resize_prob2: [0.3, 0.4, 0.3] # up, down, keep
  20. resize_range2: [0.3, 1.2]
  21. gaussian_noise_prob2: 0.5
  22. noise_range2: [1, 25]
  23. poisson_scale_range2: [0.05, 2.5]
  24. gray_noise_prob2: 0.4
  25. jpeg_range2: [30, 95]
  26. gt_size: 256
  27. queue_size: 180
  28. # dataset and data loader settings
  29. datasets:
  30. train:
  31. name: DF2K+OST
  32. type: RealESRGANDataset
  33. dataroot_gt: datasets/DF2K
  34. meta_info: datasets/DF2K/meta_info/meta_info_DF2Kmultiscale+OST_sub.txt
  35. io_backend:
  36. type: disk
  37. blur_kernel_size: 21
  38. kernel_list: ['iso', 'aniso', 'generalized_iso', 'generalized_aniso', 'plateau_iso', 'plateau_aniso']
  39. kernel_prob: [0.45, 0.25, 0.12, 0.03, 0.12, 0.03]
  40. sinc_prob: 0.1
  41. blur_sigma: [0.2, 3]
  42. betag_range: [0.5, 4]
  43. betap_range: [1, 2]
  44. blur_kernel_size2: 21
  45. kernel_list2: ['iso', 'aniso', 'generalized_iso', 'generalized_aniso', 'plateau_iso', 'plateau_aniso']
  46. kernel_prob2: [0.45, 0.25, 0.12, 0.03, 0.12, 0.03]
  47. sinc_prob2: 0.1
  48. blur_sigma2: [0.2, 1.5]
  49. betag_range2: [0.5, 4]
  50. betap_range2: [1, 2]
  51. final_sinc_prob: 0.8
  52. gt_size: 256
  53. use_hflip: True
  54. use_rot: False
  55. # data loader
  56. use_shuffle: true
  57. num_worker_per_gpu: 5
  58. batch_size_per_gpu: 12
  59. dataset_enlarge_ratio: 1
  60. prefetch_mode: ~
  61. # Uncomment these for validation
  62. # val:
  63. # name: validation
  64. # type: PairedImageDataset
  65. # dataroot_gt: path_to_gt
  66. # dataroot_lq: path_to_lq
  67. # io_backend:
  68. # type: disk
  69. # network structures
  70. network_g:
  71. type: RRDBNet
  72. num_in_ch: 3
  73. num_out_ch: 3
  74. num_feat: 64
  75. num_block: 23
  76. num_grow_ch: 32
  77. scale: 2
  78. # path
  79. path:
  80. pretrain_network_g: experiments/pretrained_models/RealESRGAN_x4plus.pth
  81. param_key_g: params_ema
  82. strict_load_g: False
  83. resume_state: ~
  84. # training settings
  85. train:
  86. ema_decay: 0.999
  87. optim_g:
  88. type: Adam
  89. lr: !!float 2e-4
  90. weight_decay: 0
  91. betas: [0.9, 0.99]
  92. scheduler:
  93. type: MultiStepLR
  94. milestones: [1000000]
  95. gamma: 0.5
  96. total_iter: 1000000
  97. warmup_iter: -1 # no warm up
  98. # losses
  99. pixel_opt:
  100. type: L1Loss
  101. loss_weight: 1.0
  102. reduction: mean
  103. # Uncomment these for validation
  104. # validation settings
  105. # val:
  106. # val_freq: !!float 5e3
  107. # save_img: True
  108. # metrics:
  109. # psnr: # metric name
  110. # type: calculate_psnr
  111. # crop_border: 4
  112. # test_y_channel: false
  113. # logging settings
  114. logger:
  115. print_freq: 100
  116. save_checkpoint_freq: !!float 5e3
  117. use_tb_logger: true
  118. wandb:
  119. project: ~
  120. resume_id: ~
  121. # dist training settings
  122. dist_params:
  123. backend: nccl
  124. port: 29500