Stripformer: Strip Transformer for Fast Image Deblurring
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
pp00704831 f8ac53b7a7
Add files via upload
3 years ago
Figure Delete test 3 years ago
config first version 3 years ago
datasets first version 3 years ago
models first version 3 years ago
out first version 3 years ago
util first version 3 years ago
README.md Update README.md 3 years ago
aug.py first version 3 years ago
dataset.py first version 3 years ago
evaluate_RealBlur_J.py first version 3 years ago
evaluate_RealBlur_R.py first version 3 years ago
evaluation_GoPro.m Add files via upload 3 years ago
evaluation_HIDE.m Add files via upload 3 years ago
metric_counter.py first version 3 years ago
predict_GoPro_test_results.py first version 3 years ago
predict_HIDE_results.py first version 3 years ago
predict_RealBlur_J_test_results.py first version 3 years ago
predict_RealBlur_R_test_results.py first version 3 years ago
schedulers.py first version 3 years ago
train_Stripformer_gopro.py first version 3 years ago
train_Stripformer_pretrained.py first version 3 years ago

README.md

Stripformer: Strip Transformer for Fast Image Deblurring (ECCV 2022 Oral)

Pytorch Implementation of "Stripformer: Strip Transformer for Fast Image Deblurring"

Installation

The implementation of our BANet is modified from "DeblurGANv2"

git clone https://github.com/pp00704831/Stripformer.git
cd Stripformer
conda create -n Stripformer python=3.6
source activate Stripformer
conda install pytorch==1.8.0 torchvision==0.9.0 torchaudio==0.8.0 cudatoolkit=11.1 -c pytorch -c conda-forge
pip install opencv-python tqdm pyyaml joblib glog scikit-image tensorboardX albumentations==1.1.0
pip install -U albumentations[imgaug]

Training

Download "GoPro" dataset into './datasets'
For example: './datasets/GoPro/train/blur/**/*.png'

We train our Stripformer in two stages:
1) We pre-train Stripformer for 3000 epochs on patch size 256x256. Please run the following commands.

python pretrained.py

2) After stage 1, we keep training Stripformer for 1000 epochs on patch size 512x512. Please run the following commands.

python train.py

Testing

For reproducing our results on GoPro and HIDE dataset, download the "Stripformer_gopro.pth"

For reproducing our results on RealBlur dataset, download "Stripformer_realblur_J.pth" and "Stripformer_realblur_R.pth"

  • For testing on GoPro test set
    Download "GoPro" full dataset or test set into './datasets'
    For example: './datasets/GoPro/test/blur/**/*.png'
python predict_GoPro_test_results --weights_path ./Stripformer_gopro.pth 
  • For testing on HIDE dataset
    Download "HIDE" into './datasets'
python predict_HIDE_results --weights_path ./Stripformer_gopro.pth 
python predict_RealBlur_J_test_results --weights_path ./Stripformer_realblur_J.pth 
python predict_RealBlur_R_test_results --weights_path ./Stripformer_realblur_R.pth 
  • For testing your own training weight (take GoPro for a example)
  1. Rename the path in line 23 in the predict_GoPro_test_results.py
  2. Chage command to --weights_path ./final_Stripformer_gopro.pth when testing

Evaluation

evaluation_GoPro.m
evaluation_HIDE.m
python evaluate_RealBlur_J.py
python evaluate_RealBlur_R.py