SeitaroShinagawa / chainer-partial_convolution_image_inpainting

Reproduction of Nvidia image inpainting paper "Image Inpainting for Irregular Holes Using Partial Convolutions"
MIT License
114 stars 30 forks source link

Probable issue in calc_loss_tv with solution #11

Open dhruva77 opened 6 years ago

dhruva77 commented 6 years ago

In https://github.com/SeitaroShinagawa/chainer-partial_convolution_image_inpainting/blob/master/updater.py line 68, Right now it is : P = Variable(xp.sign(canvas-0.5)*0.5+1.0) #P region (hole mask: 1 pixel dilated region from hole)

while it should probably should be ( I donot use chainer so not sure about this): P = Variable(xp.sign(canvas-0.5)+1.0)*0.5 #P region (hole mask: 1 pixel dilated region from hole)

Reason because the canvas would have all the values with dilation 1 from the holes with values>0 So P should be 1 for the values>0 and 0 for values =0

SeitaroShinagawa commented 6 years ago

Thanks for informing! This is my stupid bug.
P should be composed of 0 and 1, but it was 0.5 and 1.5. I have fix it in https://github.com/SeitaroShinagawa/chainer-partial_convolution_image_inpainting/commit/17cc6326b0407a6296d5aa46dc5089e5ec37179b.

dhruva77 commented 6 years ago

No worries, The code is very well written and is quite easy to read. Thanks for the effort. Between did you train it with 512 size as you had mentioned in an earlier issue? Also the results shown do-not compare very well with the original paper and they are a bit old( since you have changed the implementation quite a bit since then) . Were you able to reproduce the results ?

SeitaroShinagawa commented 6 years ago

I'm sorry, not yet. I submitted a job before, but it has stopped due to a machine management reason, and I completely forgot that...
I have submitted another job now. It takes around 5 days without fine-tuning stage.

I will fix the differences from the original paper such as the way of generating mask.
However, I can't spare time to do that in a few months. I will be happy if someone can fix the differences via pull-request.