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:
Download our LFDOF dataset from Project Page.
Download the pre-trained weights from Google Drive.
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.
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
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}
}
This software is being made available under the terms in the LICENSE file.
Part of the code is adapted from DMENet.