XPixelGroup / BasicSR

Open Source Image and Video Restoration Toolbox for Super-resolution, Denoise, Deblurring, etc. Currently, it includes EDSR, RCAN, SRResNet, SRGAN, ESRGAN, EDVR, BasicVSR, SwinIR, ECBSR, etc. Also support StyleGAN2, DFDNet.
https://basicsr.readthedocs.io/en/latest/
Apache License 2.0
6.64k stars 1.17k forks source link

How did you train the RRDB_PSNR_x4 ? #80

Open zengzhanhang opened 5 years ago

zengzhanhang commented 5 years ago

Hi

Modeds Short Description
RRDB_ESRGAN_x4.pth final ESRGAN model we used in our paper
RRDB_PSNR_x4.pth model with high PSNR performance

As far as I know, you use the RRDB_PSNR_x4 as the pretrained model for your ESRGAN. May I ask how did you get this pretrained model? Is it the same architecture as the ESRGAN and the only difference is using different pretrained model?

Best Regards,

xinntao commented 5 years ago

same arch as the ESRGAN but with the L1 loss to train the model.

zengzhanhang commented 5 years ago

May I ask what's the pretrained model for PSNR-oriented ESRGAN?

zengzhanhang commented 5 years ago

May I ask what's the pretrained model for PSNR-oriented ESRGAN?

I think I know what's the pretrained model. But how can I choose the model, because the PSNR is going down when training the model.

xinntao commented 5 years ago

RRDB_PSNR_x4.pth is the PSNR-oriented model.

Did you mean how to choose the model when fine-tuning with gan loss? Just from the image visual quality of the results. It is a pity that there is no good way.

xiaozhi2015 commented 5 years ago

How to modify the original loss to L1 loss for training the RRDB_PSNR_x4? @xinntao Much thx.

xinntao commented 5 years ago

@xiaozhi2015 Using L1 loss is simple with configuration "pixel_criterion": "l1". L1 loss is in https://github.com/xinntao/BasicSR/blob/c69bf49f0185f9d02f379dffc7b3b88265010b31/codes/models/SR_model.py#L29-L30

xiaozhi2015 commented 5 years ago

Thx xintao. And what value should I set "pixel_criterion" when training RRDB_ESRGAN_x4? It seems that it only include "l1" and "l2". @xinntao

xinntao commented 5 years ago

Take a look at this file

xiaozhi2015 commented 5 years ago

@xinntao In this file, "pixel_criterion" is already set to "l1". When training "RRDB_PSNR_x4", "pretrain_model_G" shoud be set to "null"; when training "RRDB_ESRGAN_x4", "pretrain_model_G" shoud point to the previous "RRDB_PSNR_x4" model. Anything else should I change, especially the "pixel_criterion" value?

xinntao commented 5 years ago

pixel_criterion l1 Using the default value is OK.

GuitarZhang commented 5 years ago

@xinntao Does training RRDB_PSNR_x4 include generator only, not include discriminator? Like "python train.py -opt options/train/train_SRResNet.yml", but need set "which_model_G:RRDBNet" , "nb: 23" and so on.

xinntao commented 5 years ago

Yes, training RRDB_PSNR_x4 only includes the generator.

lingwei0816 commented 4 years ago

Hi,Do you try train the pretrained model (RRDB_PSNR_x4 ) with l2 loss ? Which is better?

JingyunLiang commented 4 years ago

In practice, can we use just the following settings?

  pixel_criterion: l1
  pixel_weight: !!float 1e-2
  feature_criterion: l1
  feature_weight: 0
  gan_type: ragan  # gan | ragan
  gan_weight: 0

Should we set the pixel_weight as 1? @xinntao