-Train datasets: Rain13K
-Test datasets: Rain100L, Rain100H, Test100, Test2800
-Val dataset: To accelerate the training speed, we selected the first image from the Rain100L test set as the validation set.
- The above dataset path is as follows
Deraining/Datasets
├──train
├──input
└──target
├──val
├──input
└──gt
└──test
├──Test100
├──input
└──target
├──Rain100H
├──input
└──target
├──Rain100L
├──input
└──target
└──Test2800
├──input
└──target
First, modify the path where the project is located in the second line of the /basicsr/train.py file.
-
To train C2F-DFT in the coarse training pipeline, modify the comments on lines 129-134 and 195-237 in the /basicsr/models/image_restoration_model.py file, then run
cd C2F-DFT-main python -m torch.distributed.launch --nproc_per_node=2 --master_port=4321 basicsr/train.py -opt Deraining/Options/Deraining_C2F-DFT_Coarse.yml --launcher pytorch
-
To train C2F-DFT in the fine training pipeline, modify the comments on lines 137-145 and 240-286 in the /basicsr/models/image_restoration_model.py file, then run
cd C2F-DFT-main python -m torch.distributed.launch --nproc_per_node=2 --master_port=4321 basicsr/train.py -opt Deraining/Options/Deraining_C2F-DFT_Fine.yml --launcher pytorch
-
Download the pre-trained model and place it in
./pretrained_models/
-
Testing
Modify the path where the project is located in the second line of the Deraining/test.py file
cd Deraining python test.py
-
Calculating PSNR/SSIM scores, run
python calculate_psnr_ssim.py