nipponjo / deepfillv2-pytorch

A PyTorch reimplementation of the paper Free-Form Image Inpainting with Gated Convolution (DeepFill v2) (https://arxiv.org/abs/1806.03589)
139 stars 31 forks source link

how to generate test masks? #13

Open qsc227 opened 1 year ago

qsc227 commented 1 year ago

Hello,Thanks for your code! I would like to know how do you generate your test masks? I find that when i try to use pretrained models to test on my masked images,the results seems to be not very good.

image image
nipponjo commented 1 year ago

Hello, I used the demo app to draw the masks in the examples/inpaint/ folder.

qsc227 commented 1 year ago

why i try to push the impaint button , there is nothing like this?

image
nipponjo commented 1 year ago

I'm not sure. By default, the weight files (e.g. states_tf_places2.pth) need to be put into the pretrained/ folder. The path to the files can be changed in app/models.yaml.

juntaosun commented 1 year ago

我也遇到同样的问题,使用示例的图片和mask一切正常 I also have the same problem, Everything works fine with the picture and mask of the example

当我使用photoshop进行蒙版绘制,它的结果不正常。在PS中使用白色画笔和透明区,保存为png格式。 when I use photoshop for mask drawing, it doesn't work. Use white brush and transparent area in PS, save as png format.

那么在PS中,该如何正确绘制mask? So in PS, how to draw the mask correctly ?

nipponjo commented 1 year ago

It seem like PS saves the channels in a different order, so that mask = mask[0:1, :h//grid*grid, :w//grid*grid].unsqueeze(0) (e.g., in test.py) should be changed to mask = mask[3:4, :h//grid*grid, :w//grid*grid].unsqueeze(0)

I will look into this further later.