RaphaelMeudec / deblur-gan

Keras implementation of "DeblurGAN: Blind Motion Deblurring Using Conditional Adversarial Networks"
588 stars 244 forks source link

Training images. #18

Open shivam2296 opened 6 years ago

shivam2296 commented 6 years ago

Can anyone tell me the number of training images used in generator.h5 ?

RaphaelMeudec commented 6 years ago

Hi! I've been training the model on the full GOPRO dataset training set

shivam2296 commented 6 years ago

What was the batch size? I find that there is always some distortion in the output images. Any suggestions? As suggested by you, I'm processing the image patch by patch. The code works well. Great work! frame46 frame46_ne1x

wiwengweng commented 6 years ago

Hi, there. I am too learning this project for deblurring. I use the command python train.py --n_images=512 --batch_size=16 to train my model, but when I deblur my image, I see the deblurred image full of small grids. Are these so called 'checkerboard artifacts'?? So can I train the model with other parameters? Or any suggestion to achieve your goal is appreciated.

TarzanWonder commented 6 years ago

hi can you please provide your directory structure?

wiwengweng commented 6 years ago

the directory is not changed as default. Here it is:

root@bogon:~/deblur-gan-master# tree -L 3 ./
./
├── 001.jpg
├── 20180808143508.jpg
├── deblur001.jpg
├── deblur20180808143508.jpg
├── deblur_image.py
├── generator.h5
├── GOPRO_Large
│   ├── test
│   │   ├── GOPR0384_11_00
│   │   ├── GOPR0384_11_05
│   │   ├── GOPR0385_11_01
│   │   ├── GOPR0396_11_00
│   │   ├── GOPR0410_11_00
│   │   ├── GOPR0854_11_00
│   │   ├── GOPR0862_11_00
│   │   ├── GOPR0868_11_00
│   │   ├── GOPR0869_11_00
│   │   ├── GOPR0871_11_00
│   │   └── GOPR0881_11_01
│   └── train
│       ├── GOPR0372_07_00
│       ├── GOPR0372_07_01
│       ├── GOPR0374_11_00
│       ├── GOPR0374_11_01
│       ├── GOPR0374_11_02
│       ├── GOPR0374_11_03
│       ├── GOPR0378_13_00
│       ├── GOPR0379_11_00
│       ├── GOPR0380_11_00
│       ├── GOPR0384_11_01
│       ├── GOPR0384_11_02
│       ├── GOPR0384_11_03
│       ├── GOPR0384_11_04
│       ├── GOPR0385_11_00
│       ├── GOPR0386_11_00
│       ├── GOPR0477_11_00
│       ├── GOPR0857_11_00
│       ├── GOPR0868_11_01
│       ├── GOPR0868_11_02
│       ├── GOPR0871_11_01
│       ├── GOPR0881_11_00
│       └── GOPR0884_11_00
├── GOPRO_Large.zip
├── images
│   ├── test
│   │   ├── A
│   │   └── B
│   └── train
│       ├── A
│       └── B
├── layer_utils.py
├── log.txt
├── losses.py
├── model.py
├── organize_gopro_dataset.py
├── __pycache__
│   ├── layer_utils.cpython-35.pyc
│   ├── losses.cpython-35.pyc
│   ├── model.cpython-35.pyc
│   └── utils.cpython-35.pyc
├── README.md
├── requirements-gpu.txt
├── requirements.txt
├── test.py
├── train.py
├── utils.py
├── venv
│   ├── bin
│   │   ├── activate
│   │   ├── activate.csh
│   │   ├── activate.fish
│   │   ├── activate_this.py
│   │   ├── easy_install
│   │   ├── easy_install-3.5
│   │   ├── f2py
│   │   ├── freeze_graph
│   │   ├── markdown_py
│   │   ├── pip
│   │   ├── pip3
│   │   ├── pip3.5
│   │   ├── pip-autoremove
│   │   ├── python -> python3
│   │   ├── python3
│   │   ├── python3.5 -> python3
│   │   ├── python-config
│   │   ├── saved_model_cli
│   │   ├── skivi
│   │   ├── tensorboard
│   │   ├── tflite_convert
│   │   ├── toco
│   │   ├── toco_from_protos
│   │   ├── tqdm
│   │   └── wheel
│   ├── include
│   │   └── python3.5m -> /usr/include/python3.5m
│   ├── lib
│   │   └── python3.5
│   ├── man
│   │   └── man1
│   ├── pip-selfcheck.json
│   └── share
│       ├── doc
│       └── python-wheels
└── weights
    └── 88
        ├── discriminator_0.h5
        ├── discriminator_10.h5
        ├── discriminator_11.h5
        ├── discriminator_12.h5
        ├── discriminator_13.h5
        ├── discriminator_14.h5
        ├── discriminator_15.h5
        ├── discriminator_16.h5
        ├── discriminator_17.h5
        ├── discriminator_18.h5
        ├── discriminator_19.h5
        ├── discriminator_1.h5
        ├── discriminator_2.h5
        ├── discriminator_3.h5
        ├── discriminator_4.h5
        ├── discriminator_5.h5
        ├── discriminator_6.h5
        ├── discriminator_7.h5
        ├── discriminator_8.h5
        ├── discriminator_9.h5
        ├── generator_0_1180.h5
        ├── generator_0_1413.h5
        ├── generator_10_663.h5
        ├── generator_1_1040.h5
        ├── generator_11_654.h5
        ├── generator_12_643.h5
        ├── generator_13_645.h5
        ├── generator_14_643.h5
        ├── generator_15_631.h5
        ├── generator_16_625.h5
        ├── generator_17_623.h5
        ├── generator_1_851.h5
        ├── generator_18_616.h5
        ├── generator_19_605.h5
        ├── generator_2_769.h5
        ├── generator_2_913.h5
        ├── generator_3_723.h5
        ├── generator_3_819.h5
        ├── generator_4_696.h5
        ├── generator_4_766.h5
        ├── generator_5_735.h5
        ├── generator_6_712.h5
        ├── generator_7_697.h5
        ├── generator_8_681.h5
        └── generator_9_672.h5
wiwengweng commented 6 years ago

deblur20180808143508 I also add a test result here, please check.

TarzanWonder commented 6 years ago

Can you please add your weights and code to test it? Please?

wiwengweng commented 6 years ago

did you mean train my own model and test?

TarzanWonder commented 6 years ago

Yes please. I am using cpu and i can't get my model train. If you can upload,it will be a great help and a great learning

wiwengweng commented 6 years ago

I just use Raphael's model and test. It seems he trained the model with full GOPRO dataset.

TarzanWonder commented 6 years ago

But i tested it on few images and accuracy was not good

wiwengweng commented 6 years ago

so I don't know how @shivam2296 deblur his image and get that result. My result is not as good.

prash030 commented 6 years ago

Hi @wiwengweng What was the generator and discriminator losses when you stopped the training? I am getting -0.5 for discriminator and 150 for generator, which doesn't make sense.

wiwengweng commented 6 years ago

= =,I don't quite work on this right now. But not so good.

shivam2296 commented 6 years ago

Hello, I have not changed any of the settings while testing. I haven't even trained the model for my image set. I have just divided the image into patches, processed each of them individually and then stitched them back to form the image.

I tried training the model for higher number of images and for higher epoch, but the result was not good.

prash030 commented 6 years ago

Ok Thank you @wiwengweng and @shivam2296

yff0815 commented 5 years ago

hello,how to test my own picture? I used this command python scripts/deblur_image.py --image_path='/home/deblur-gan-master/test_image/000001.png' And then it will be an error below

FileNotFoundError: [Errno 2] No such file or directory: '/test_image/000001.png'
IsADirectoryError: [Errno 21] Is a directory: 'test_image'

And anything wrong with it? Hope you help,thanks! @wiwengweng and @shivam2296

shivam2296 commented 5 years ago

Hello All! I have added the patching code and unifying code. In this implementation you have to just give the image as input. Check out! -> https://github.com/shivam2296/deblur-gan

wiwengweng commented 5 years ago

@yff0815 I think you can try to provide a directory, but not a image file path. Hope this helps. I am not working on this piece right now, but can still discuss issues. Thanks.

sunshine2004 commented 5 years ago

When I extracted the downloaded image package, I found the images' number in folder A is slightly different from that in B, and seriously affect the training losses. After synchronization, the results get much better.

tanjhysj0 commented 5 years ago

who can tell me how to get to the train data?I can't download!

wiwengweng commented 5 years ago

@tanjhysj0 dataset is GOPRO_Large.zip or you can download a slim version for test~ Just google it~ :D

gevindharmalim commented 3 years ago

When I extracted the downloaded image package, I found the images' number in folder A is slightly different from that in B, and seriously affect the training losses. After synchronization, the results get much better.

hi, how to display the training losses in tensorboard ?