Skip to content

Latest commit

 

History

History
65 lines (49 loc) · 2.57 KB

README.md

File metadata and controls

65 lines (49 loc) · 2.57 KB

Datasets

-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

Training

First, modify the path where the project is located in the second line of the /basicsr/train.py file.

  1. 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
    
  2. 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
    

Testing

  1. Download the pre-trained model and place it in ./pretrained_models/

  2. Testing

    Modify the path where the project is located in the second line of the Deraining/test.py file

    cd Deraining
    python test.py
    
  3. Calculating PSNR/SSIM scores, run

    python calculate_psnr_ssim.py