Skip to content

Latest commit

 

History

History

Uformer-RSBlur

Realistic Blur Synthesis for Learning Image Deblurring

Pytorch Implementation of ECCV Paper

Realistic Blur Synthesis for Learning Image Deblurring
Jaesung Rim, Geonung Kim, Jungeon Kim, Junyong Lee, Seungyong Lee, Sunghyun Cho.
POSTECH
IEEE European Conference on Computer Vision (ECCV) 2022

Results on the RealBlur-J.

Models Train set Realistic Pipeline PSNR / SSIM
Uformer-B GoPro 30.98 / 0.9067
Uformer-B GoPro 29.08 / 0.8754
Uformer-B GoPro_U 31.19 / 0.9143
Uformer-B GoPro_U 28.93 / 0.8673

Tested environment

We recommend a virtual environment using conda or docker.

Uformer
  • Pytorch 1.9.0
  • cuda11.1

Pre-trained models [Google Drive]

Descriptions (click)
  • Uformer_B_RealisticGoProABMEDeblur.pth : Trained on GoPro_INTER_ABME with our synthesis pipeline.
  • Uformer_B_NaiveGoProABMEDeblur.pth : Trained on GoPro_INTER_ABME in the Naive way.
  • Uformer_B_RealisticGoProUDeblur.pth : Trained on GoPro_U with our synthesis pipeline.
  • Uformer_B_NaiveGoProUDeblur.pth : Trained on GoPro_U in the Naive way.

RSBlur pipeline for RealBlur

We provide simple Dataset modules for adopting our pipeline. This is slightly different from the tensorflow implementation. Please check the below codes.

# ./Uformer-RSBlur/dataset/dataset_RealisticDeblur.py

class RealisticGoProABMEDataset(Dataset):
    def __init__(self, image_dir, patch_size=256, image_aug=True, realistic_pipeline=True):
        ...

    def __len__(self):
        return len(self.image_list)

    def __getitem__(self, idx):
        ...

class RealisticGoProUDataset(Dataset):
    def __init__(self, image_dir, patch_size=256, image_aug=True, realistic_pipeline=True):
        ...

    def __len__(self):
        return len(self.image_list)

    def __getitem__(self, idx):
        ...

Training

# ./Uformer-RSBlur
# All datasets should be located in Uformer-RSBlur/datasets
# require two of 3090, 4~5 days

# GoPro_INTER_ABME with our pipeline
python3 train/train_RealisticGoProABMEDeblur.py --arch Uformer_B --batch_size 8 --gpu '0,1' \
 --train_ps 256 --train_dir datasets/GOPRO_INTER_ABME \
 --val_ps 256 --val_dir datasets/RealBlurJ_test --env _RealisticGoProABMEDeblur \
 --mode deblur --nepoch 1500 --checkpoint 100 --dataset GoPro --warmup --train_workers 12

# GoPro_U with our pipeline
python3 train/train_RealisticGoProUDeblur.py --arch Uformer_B --batch_size 8 --gpu '0,1' \
 --train_ps 256 --train_dir datasets/GOPRO_INTER_ABME \
 --val_ps 256 --val_dir datasets/RealBlurJ_test --env _RealisticGoProUDeblur \
 --mode deblur --nepoch 1500 --checkpoint 100 --dataset GoPro --warmup --train_workers 12

Testing

# ./Uformer-RSBlur
# All datasets should be located in Uformer-RSBlur/datasets

# Test on the RealBlur
python3 test/test_realblur_reflect.py --input_dir ./datasets/ --result_dir ./results/Uformer_B_RealisticGoProUDeblur/ --weights ./logs/Uformer_B_RealisticGoProUDeblur.pth;

# Test on the RealBlur
python3 test/test_realblur_reflect.py --input_dir ./datasets/ --result_dir ./results/Uformer_B_RealisticGoProABMEDeblur_mark9/ --weights ./logs/Uformer_B_RealisticGoProABMEDeblur.pth;