Home

Awesome

AIFNet: All-in-Focus Image Restoration Network Using a Light Field-Based Dataset

AIFNet: All-in-Focus Image Restoration Network Using a Light Field-Based Dataset

Lingyan Ruan, Bin Chen, Jizhou Li, Miu-Ling LAM

Official Tensorflow implementation of the paper AIFNet. Our network takes defocus image as an input and restore the corresponding all-in-focus image, as shown in the example:

<img src="teaser/plant.gif" width="400px"/> <img src="teaser/corridor.gif" width="400px"/>

Only testing now, training coming soon...

Environment

Ubuntu Python 3.6 TensorFlow 1.13.1 TensorLayer 1.11.1 CUDA 10.2.89 CUDNN 7.5.0

LFDOF Dataset

Download our LFDOF dataset from Project Page.

Pre-trained weights

Download the pre-trained weights from Google Drive.

How to test

Put the weights into:

AIFNet/weights

Test our LFDOF test set:

python test.py -d LFDOF -r 688 -c 1008 -gt 1 -p ./test_set/LFDOF/input -gtp ./test_set/LFDOF/ground_truth

You can also run testing on all test sets by:

python run_test.py

To test with your own blurry images into a folder and run for example:

python test.py -d [name of your test set] -r [rows] -c [columns] -gt [1: have ground truth; 0: no ground truth] -p [path to your testing image] -gtp [path to your ground truth image if you have]

Please note that the spatial resolution of image sourced from DPD dataset has been reduced when tested on AIFNet since it has limitation dealing with very high-resolution defocused image.

Relevant datasets

DUT-DBD dataset : Defocus Blur Detection via Multi-Stream Bottom-Top-Bottom Network

CUHK dataset : Discriminative Blur Detection Features

DPD dataset : Defocus Deblurring Using Dual-Pixel Data

RTF dataset : Non-Parametric Blur Map Regression for Depth of Field Extension

Citation

If you find our code helpful in your research or work please cite our paper.

@article{ruan2021aifnet,
    title={AIFNet: All-in-Focus Image Restoration Network Using a Light Field-Based Dataset},
    author={Ruan, Lingyan and Chen, Bin and Li, Jizhou and Lam, Miu-Ling},
    journal={IEEE Transactions on Computational Imaging},
    volume={7},
    pages={675--688},
    year={2021},
    publisher={IEEE}
    doi={10.1109/TCI.2021.3092891}
}

License

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

Acknowledgments

Part of the code is adapted from DMENet.