Skip to content

[CVPR Oral 2022] PyTorch Implementation for "Learning to Deblur using Light Field Generated and Real Defocused Images"

License

Notifications You must be signed in to change notification settings

lingyanruan/DRBNet

Repository files navigation

Learning to Deblur using Light Field Generated and Real Defocused Images

License CC BY-NC Colab

teaser figure

This repository contains the official PyTorch implementation of the following paper:

Learning to Deblur using Light Field Generated and Real Defocused Images
Lingyan Ruan*, Bin Chen*, Jizhou Li, Miuling Lam (* equal contribution)
IEEE Computer Vision and Pattern Recognition (CVPR Oral) 2022

PROJECT PAGE | INTERACTIVE WEB APP

If you find our code useful, please consider citing our paper:

 @inproceedings{ruan2022learning,
  title={Learning to Deblur using Light Field Generated and Real Defocus Images},
  author={Ruan, Lingyan and Chen, Bin and Li, Jizhou and Lam, Miuling},
  booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  pages={16304--16313},
  year={2022}
}

Code

Prerequisites

Ubuntu Python CUDA PyTorch

Notes: the code may also work with other library versions that didn't specify here.

1. Installation

Clone this project to your local machine

$ git clone https://github.com/lingyanruan/DRBNet.git
$ cd DRBNet

2. Environment setup

$ conda create -y --name DRBNet python=3.8.13 && conda activate DRBNet
$ sh install_CUDA11.1.1.sh
# Other version will be checked and updated later.

3. Pre-trained models

Download and unzip [pretrained weights] under ./ckpts/:

$ python download_ckpts.py 
# Weights will be placed in ./ckpts/

4. Datasets download

$ python download_test_set.py --DPDD --RealDOF --CUHK --PixelDP 
# You may skip donwload the specific dataset by removing name, e.g., remove --PixelDP with command python download_test_set.py --DPDD --RealDOF --CUHK 

The original full datasets could be found here: (LFDOF, DPDD, CUHK and RealDOF):

5. Command Line

# Single Image input
$ python run.py --net_mode single --eval_data DPDD --save_images
# eval_data could be RealDOF, CUHK, PixelDP. 


# Dual Image Input - DPDD Dataset
python run.py --net_mode dual --eval_data DPDD --save_images

Performance improved on existing works - [DPDNet & KPAC]

You may go for DPDNet and KPAC-Net for their improved version. Details could be found in [Why LFDOF?] section (Table 4 & Figure 8) in the main paper. Their original version could be found Here: DPDNet-scr and Here: KPAC-Net-scr

Relevant Resources

Contact

Should you have any questions, please open an issue or contact me lyruanruan@gmail.com

Acknowledgment: Some of the codes are based on the IFAN

License

This software is being made available under the terms in the LICENSE file.

About

[CVPR Oral 2022] PyTorch Implementation for "Learning to Deblur using Light Field Generated and Real Defocused Images"

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published