/DeblurGAN-tf

Tensorflow implementation of DeblurGAN(Blind Motion Deblurring Using Conditional Adversarial Networks)

Primary LanguagePython

DeblurGAN : Blind Motion Deblurring Using Conditional Adversarial Networks

An implementation of DeblurGAN described in the paper using tensorflow.

Published in CVPR 2018, written by O. Kupyn, V. Budzan, M. Mykhailych, D. Mishkin and J. Matas

Requirement

  • Python 3.6.5
  • Tensorflow 1.10.1
  • Pillow 5.0.0
  • numpy 1.14.5
  • Pretrained VGG19 file : vgg19.npy (for training!)

Datasets

Pre-trained model

Train using GOPRO dataset

  1. Download pretrained VGG19 file vgg19.npy

  2. Download GOPRO dataset GOPRO dataset

  3. Preprocessing GOPRO dataset.

python GOPRO_preprocess.py --GOPRO_path ./GOPRO/data/path --output_path ./data/output/path
  1. Train using GOPRO dataset.
python main.py --train_Sharp_path ./GOPRO/path/sharp --train_Blur_path ./GOPRO/path/blur

Train using your own dataset

  1. Download pretrained VGG19 file vgg19.npy

  2. Preprocess your dataset. Blur image and sharp image pair should have same index when they are sorted by name respectively.

  3. Train using GOPRO dataset.

python main.py --train_Sharp_path ./yourData/path/sharp --train_Blur_path ./yourData/path/blur

Deblur your own images

  1. Download pre-trained model. pre_trained_model

  2. Unzip the pre-trained model file

tar -cvf DeblurGAN_model.tar
  1. Deblur your own images
python main.py --mode test_only --pre_trained_model ./path/to/model --test_Blur_path ./path/to/own/images
  1. If you have an out of memory(OOM) error, please use chop_forward option
python main.py --mode test_only --pre_trained_model ./path/to/model --test_Blur_path ./path/to/own/images --in_memory True --chop_forward True

Experimental Results

Experimental results on GOPRO dataset

Blur Result Ground Truth

Comments

If you have any questions or comments on my codes, please email to me. son1113@snu.ac.kr

Reference

[1]. https://github.com/KupynOrest/DeblurGAN

[2]. https://github.com/machrisaa/tensorflow-vgg

  • vgg19.py is fixed for my implementation.