Please prepare the training dataset following the instructions in BasicSR.
sh trainS1.sh
#set the 'pretrain_network_g' and 'pretrain_network_S1' in ./options/train_DiffIRS2_x4.yml to be the path of DiffIR_S1's pre-trained model
sh trainS2.sh
#set the 'pretrain_network_g' and 'pretrain_network_S1' in ./options/train_DiffIRS2_GAN_x4.yml to be the path of DiffIR_S2 and DiffIR_S1's trained model, respectively.
sh trainS2.sh
Note: The above training script uses 8 GPUs by default.
Download the pre-trained model and place it in ./experiments/
Please download the testing datasets from GoogleDrive (or Baidu Disk or OneDrive).
- Testing
# modify the dataset path in ./options/test_DiffIRS2_GAN_x4.yml
sh test.sh
python3 Metric/PSNR.py --folder_gt PathtoGT --folder_restored PathtoSR
python3 Metric/LPIPS.py --folder_gt PathtoGT --folder_restored PathtoSR
python3 Metric/dists.py --folder_gt PathtoGT --folder_restored PathtoSR