knazeri / edge-connect

EdgeConnect: Structure Guided Image Inpainting using Edge Prediction, ICCV 2019 https://arxiv.org/abs/1901.00212
http://openaccess.thecvf.com/content_ICCVW_2019/html/AIM/Nazeri_EdgeConnect_Structure_Guided_Image_Inpainting_using_Edge_Prediction_ICCVW_2019_paper.html
Other
2.5k stars 530 forks source link

Masked image from results doesn't match input #145

Closed violetamenendez closed 4 years ago

violetamenendez commented 4 years ago

Hi,

I have run this model before successfully before with my own image, using the masks provided by the dataset you used. I have tried using it again with my own masks, but the results I am getting are like the masked region is way bigger than the one I am actually using, so the edge model doesn't work properly, as there is too much area too inpaint. Doo you have any idea of what I could be doing wrong?

Images: Input image and mask input_image

input_mask

Debugging result output, masked, egde, and final inpainted result: output_masked

output_edge

output-result

config.yml

MODE: 2 # 1: train, 2: test, 3: eval MODEL: 3 # 1: edge model, 2: inpaint model, 3: edge-inpaint model, 4: joint model MASK: 3 # 1: random block, 2: half, 3: external, 4: (external, random block), 5: (external, random block, half) EDGE: 1 # 1: canny, 2: external NMS: 1 # 0: no non-max-suppression, 1: applies non-max-suppression on the external edges by multiplying by Canny SEED: 10 # random seed GPU: [0] # list of gpu ids DEBUG: 1 # turns on debugging mode VERBOSE: 0 # turns on verbose mode in the output console

running command: python test.py --input examples/myimages/images/occ0-test-small-square.png --mask examples/myimages/masks/mask0-test-small-square.png --output checkpoints/myimages-results/occ0_output --checkpoints checkpoints/places2/

violetamenendez commented 4 years ago

Turns out I reduced the size of the mask image using bilinear interpolation so the values weren't black & white, but they have greys inbetween which was confusing the mode. I used nearest neighbours to reduce the size and it's working now.

Apologies for the noise.