Skip to content

Latest commit

 

History

History
78 lines (57 loc) · 2.86 KB

README.md

File metadata and controls

78 lines (57 loc) · 2.86 KB

Datasets

-Train datasets: GoPro

-Test datasets: GoPro, RealBlur_R, RealBlur_J

-Val dataset: To accelerate the training speed, we selected the first image from the GoPro test set as the validation set.

  • The above dataset path is as follows

Deblurring/Datasets
├──train
          ├──input
          └──target
├──val
          ├──input
          └──gt
└──test
     ├──GoPro
          ├──input
          └──target
     ├──RealBlur_J
          ├──input
          └──target
     └──RealBlur_R
          ├──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 Deblurring/Options/Deblurring_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 Deblurring/Options/Deblurring_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 Deblurring/test.py file

    Testing on GoPro dataset, run

    cd Deblurring
    python test.py
    

    Testing on RealBlur dataset, run

    cd Deblurring
    python test_real.py
    
  3. Calculating PSNR/SSIM scores

    Calculate GoPro dataset, run

    python calculate_psnr_ssim.py
    

    Calculate RealBlur dataset, run

    python evaluate_realblur.py