thuanz123 / realfill

Unofficial implementation of RealFill
MIT License
359 stars 27 forks source link

process on the border of mask and original images #3

Closed xinli2008 closed 1 year ago

xinli2008 commented 1 year ago

sorry to bother you again. I notice that you process the border of dataset masks and original images during inference: image I do the process according to paper, but output bad results! would you like to provide the process code ? Best

thuanz123 commented 1 year ago

the mask is only process after the inference not during. I will try to add a simple code for this but there is only three steps:

  1. run the code infer.py normally and select the best output as you like
  2. blur the input mask
  3. blend the original masked image and the output chosen in step 1 using the blur mask in step 2
xinli2008 commented 1 year ago

thank you for your kindly reply and i will try the blur trick code. wIsh you have a nice weekend

thuanz123 commented 1 year ago

hi @xinli2008, I just add the blurring trick in the infer.py code and improve the training of realfill. Now you just need to do the training and run inference. All tricks in the paper have been added except the "Correspondence-Based Seed Selection" trick in sec 4.2 which is only used for evaluation

AIMads commented 1 year ago

Hey I get this error when running the inference script:

File "/home/humaid/Desktop/realfill/infer.py", line 83, in result = Image.composite(result, image, mask_image) File "/home/humaid/mambaforge/envs/realfill/lib/python3.10/site-packages/PIL/Image.py", line 3363, in composite image.paste(image1, None, mask) File "/home/humaid/mambaforge/envs/realfill/lib/python3.10/site-packages/PIL/Image.py", line 1738, in paste self.im.paste(im, box, mask.im) ValueError: images do not match