Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to prepare train data and how to train DeblurGAN? #18

Open
hrbspider opened this issue Dec 8, 2017 · 7 comments
Open

How to prepare train data and how to train DeblurGAN? #18

hrbspider opened this issue Dec 8, 2017 · 7 comments

Comments

@hrbspider
Copy link

I tried to train DeblurGAN but failed. I dont know how to prepare train data and val data and the meaning of some options,such as 'AtoB'.
I generated blured images using the code blur_image.py.
The train command:
python train.py --dataroot ../../deblurPwLine/ --continue_train

dataroot is organized as this:
-deblurPwLine
--train "stores some sharp images"
--val "stores some sharp images"

@KupynOrest
Copy link
Owner

There are few options and few choices of dataset (Aligned, Single etc.) To create aligned dataset you would need to run combine_A_and_B script to create image pairs, otherwise, you need to change the type of the dataset, I would update to instructions soon

@carlblocking
Copy link

Can you provide more information about it? @KupynOrest

@YangShuguang
Copy link

when I generated blured images using the code blur_image.py. I found a lot of picture become Black block. It seems that all the pixel value become zero. how I solve the problem? @hrbspider @KupynOrest

@pengjingg
Copy link

@YangShuguang Use scipy.misc.imsave() to save the generated blurry image instead of cv2.imwrite()

@pengjingg
Copy link

@YangShuguang You should use either OpenCV or Scipy while reading and writing images; use one to read images and another to write images would cause black block output.

@YangShuguang
Copy link

@pengjingg. are you sure? I'll try your way. now my solution is to modify the "self.max_len / (self.iters - 1))" to "self.max_len / float(self.iters - 1))" (generate_trajectory.py 80 lines). and modify "self.fraction = [1 / 100, 1 / 10, 1 / 2, 1]'' to ''self.fraction = [1/float(100), 1/float(10), 1/float(2), 1]'' (generate_PSF.py 19 lines ). it seems to work

@pengjingg
Copy link

@YangShuguang You are right. My way just solved problems for some images but won't work out for others(strange). Thanks a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants