Hanzhou Liu, Binghan Li, Chengkai Liu, Mi Lu
This is the Official Pytorch Implementation of DeblurDiNAT.
Blurry | DeblurDiNAT-L | FFTformer | Uformer-B | Stripformer | Restormer |
---|---|---|---|---|---|
The implementation is modified from "DeblurGANv2".
git clone https://github.com/HanzhouLiu/DeblurDiNAT.git
cd DeblurDiNAT
conda create -n DeblurDiNAT python=3.8
source activate DeblurDiNAT
conda install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia
pip install opencv-python tqdm pyyaml joblib glog scikit-image tensorboardX albumentations
pip install -U albumentations[imgaug]
pip install albumentations==1.1.0
The NATTEN package is required. Please follow the NATTEN installation instructions "NATTEN Homepage". Make sure Python, PyTorch, and CUDA versions are compatible with NATTEN.
Download "GoPro" dataset into './datasets'
For example: './datasets/GoPro'
We train our DeblurDiNAT in two stages:
- We pre-train DeblurDiNAT for 3000 epochs with patch size 256x256
- Run the following command
python train_DeblurDiNAT_pretrained.py
- After 3000 epochs, we keep training DeblurDiNAT for 1000 epochs with patch size 512x512
- Run the following command
python train_DeblurDiNAT_gopro.py
For reproducing our results on GoPro and HIDE datasets, download "DeblurDiNATL.pth"
For testing on GoPro dataset
- Download "GoPro" full dataset or test set into './datasets' (For example: './datasets/GoPro/test')
- Run the following command
python predict_GoPro_test_results.py --job_name DeblurDiNATL --weight_name DeblurDiNATL.pth --blur_path ./datasets/GOPRO/test/blur
For testing on HIDE dataset
- Download "HIDE" into './datasets'
- Run the following command
python predict_HIDE_results.py --weights_path ./DeblurDiNATL.pth
For testing on RealBlur test sets
- Download "RealBlur_J" and "RealBlur_R" into './datasets'
- Run the following command
python predict_RealBlur_J_test_results.py --weights_path ./DeblurDiNATL.pth
python predict_RealBlur_R_test_results.py --weights_path ./DeblurDiNATL.pth
@misc{liu2024deblurdinat,
title={DeblurDiNAT: A Lightweight and Effective Transformer for Image Deblurring},
author={Hanzhou Liu and Binghan Li and Chengkai Liu and Mi Lu},
year={2024},
eprint={2403.13163},
archivePrefix={arXiv},
primaryClass={cs.CV}
}