jiangsutx / SRN-Deblur

Repository for Scale-recurrent Network for Deep Image Deblurring
http://www.xtao.website/projects/srndeblur/srndeblur_cvpr18.pdf
MIT License
714 stars 184 forks source link

Can you please provide more information on how can I train my own mode? #40

Closed mda6 closed 5 years ago

mda6 commented 5 years ago

It's about newbies as me.. I know some python and I have never had anything to do with AI prior - I work as a visual effects artist and your results are VERY promising.. The thing is I would like to train my own model from my own images that I feed. I have access to very high quality images and the resources to train a model but with given enough time - while I cannot share the model itself I can share the results of course!

I have a few questions if you could help me please, because i am newbie...

  1. How do I actually train my own model (the deblur.model-523000.index and . meta and the .data) - this is a separate model provided by you - but how do I generate those files?

  2. When training the model and get good results - do I have to feed it with identical images one blurred and the other without blur (my question i suppose is, can I use very similar frames, but different, to train my model, as in the next frame of a movie sequence)

  3. Due to the OS we are using at work, for the time being, I cannot use the GPU - so Can I use the cpu only to train the model with 2k resolution images. What command would I use for that?

  4. How do I specify what model I want to use? python run_model.py --input_path=./testing_set --output_path=./testing_res In this command (or on the git page, I can't find any code or parameter that would specify what model to be used that are provided in the checkpoints folder (color, gray, lstm)

Thank you in advance!

jiangsutx commented 5 years ago
  1. Those 3 files *.index *.meta *.data are for one model. This is a default checkpoint file format for TensorFlow. You can doling like this: python run_model.py --phase=train --batch=16 --lr=1e-4 --epoch=4000 --datalist=<your_own_file>.txt And you can edit <your_own_file>.txt to change to your own files.

  2. Yes. You need paired data: one blurry and one clear. No. The network requires aligned data.

  3. Yes. You can run on CPU only. TensorFlow will automatically choose the correct device. It will very very slow. Maybe several months.

  4. You select by --model=gray etc. like shown in the README.md. If you want to choose your model, please go into the code and edit: https://github.com/jiangsutx/SRN-Deblur/blob/master/models/model.py#L242