debluring matlab,houkl

DeblurGAN-tf

I checked that the results are not reproduced, issue #19, and the issue is resolving

DeblurGAN: Blind Motion Deblurring Using Conditional Adversarial Networks paper

This repository is tensorflow (tf) implementation of DeblurGAN.

DeblurGAN removes blur filter in a image and make the image sharp, as follow:

44316a67ea4e188b4e3f757020b5d5f4.gif

897556f472fe552f223342e2cef45928.gif

We use tensorflow 1.7.0 and opencv-python 3.4.0.12 and only support CPU version or single GPU.

First, Download GOPRO Dataset

DeblurGAN model is trained using GOPRO dataset.

To train the model, download the dataset from website download

Unzip the dataset wherever you want, and remember the (data_path).

Model Training

You can train DeblurGAN model from the sratch, using GOPRO dataset.

(Also, you can train if you have your own blur/sharp pair images) .

python3 train.py --data_path_train (training data path) --data_path_test (test data path)

There are many argument options and you can check them in train.py .

When you use custom dataset, please set some arguments:

--resize_or_crop (default: resize) : resize or crop the input image to (img_h, img_w, img_c)

--img_h (int, default: 256)

--img_w (int, default: 256)

--img_c (int, default: 256)

When the model training ends, you can identify the results of Debluring GOPRO dataset.

The results are saved in ./test_result/

You can also change the checkpoint and tensorboard directory using args.

--checkpoint_dir (str, default: ./checkpoints)

--model_name (str, default: DeblurGAN.model)

--summary_dir (str, default: ./summaries)

Tensorboard

During training, tensorboard is available.

tensorboard --logdir=(summary path, default: './summaries') --port=(port number, default:8888)

Loss Values

d32f9320d8df032ac45bc6186b4fd125.png

Model Graph

b6b6ded016ce82f9c56f8f8afe809f3a.png

If you want to monitor intermediate results in training process, you can see the deblur image in tensorboard with additional option.

--tf_image_monitor (bool, default: False)

1f63a0654cccf1ce68de5120067478bc.png

Deblur your own Images

After training the model, you can deblur your own images using the trained model.

First, your own images have to be in same directory and same filename extension (png, jpg, or etc...).

python test.py --is_test --data_path_test (your data directory path) --img_type (image filename extension)

Two argumnets are important:

--data_path_test (str, default: None) : the your own data directory path have to be entered.

--result_dir(str, default: ./result_dir) : the dirtectory path where the sharp images are saved.

Etc

According to the original paper, model training takes about 6 days using NVIDIA TITAN X.

To increase training speed, i am writing tf.data modules to feed the data without bottleneck.

Pull request and issues are always welcome.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值