DeblurGAN-tf
DeblurGAN-tf copied to clipboard
Tensorflow implementation of DeblurGAN(Blind Motion Deblurring Using Conditional Adversarial Networks)
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
-
Download pretrained VGG19 file vgg19.npy
-
Download GOPRO dataset GOPRO dataset
-
Preprocessing GOPRO dataset.
python GOPRO_preprocess.py --GOPRO_path ./GOPRO/data/path --output_path ./data/output/path
- Train using GOPRO dataset.
python main.py --train_Sharp_path ./GOPRO/path/sharp --train_Blur_path ./GOPRO/path/blur
Train using your own dataset
-
Download pretrained VGG19 file vgg19.npy
-
Preprocess your dataset. Blur image and sharp image pair should have same index when they are sorted by name respectively.
-
Train using GOPRO dataset.
python main.py --train_Sharp_path ./yourData/path/sharp --train_Blur_path ./yourData/path/blur
Deblur your own images
-
Download pre-trained model. pre_trained_model
-
Unzip the pre-trained model file
tar -cvf DeblurGAN_model.tar
- Deblur your own images
python main.py --mode test_only --pre_trained_model ./path/to/model --test_Blur_path ./path/to/own/images
- 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. [email protected]
Reference
[1]. https://github.com/KupynOrest/DeblurGAN
[2]. https://github.com/machrisaa/tensorflow-vgg
- vgg19.py is fixed for my implementation.