Giter Club home page Giter Club logo

deblurdinat's Introduction

DeblurDiNAT: A Lightweight and Effective Transformer for Image Deblurring


Hanzhou Liu, Binghan Li, Chengkai Liu, Mi Lu

PWC PWC PWC PWC

This is the Official Pytorch Implementation of DeblurDiNAT.

Visual Results

Blurry DeblurDiNAT-L FFTformer Uformer-B Stripformer Restormer

Quantitative Results

Installation

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.

Training

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

Testing

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

python predict_RealBlur_J_test_results.py --weights_path ./DeblurDiNATL.pth 
python predict_RealBlur_R_test_results.py --weights_path ./DeblurDiNATL.pth 

Citation

@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}
}

deblurdinat's People

Contributors

hanzhouliu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.