KumapowerLIU / Rethinking-Inpainting-MEDFE

Rethinking Image Inpainting via a Mutual Encoder Decoder with Feature Equalizations. ECCV 2020 Oral
Other
371 stars 50 forks source link

Weird results for celeba dataset. #11

Open wangyx240 opened 3 years ago

wangyx240 commented 3 years ago

Hi I'm using celeba-HQ dataset and your pre-trained model for testing, and the results looks terrible(generally eyes and mouth can be found, but the details are confusing). I build the maskes as centered mask(1 in the middle square and the rest is 0) and anything else unchanged. Is there anything I need to pay attention when running the test script? Could you please help check the pre-trained model? Thanks a lot!

KumapowerLIU commented 3 years ago

Hello, maybe you use the celeba dataset can get better results. The pre-trained model is for the celeba not hq. If you want to test the code in celeba-HQ, I think you can retrain. And I am not sure that your mask is correct. I will update the code soon and tell you how to train your own data.

wangyx240 commented 3 years ago

Hello, maybe you use the celeba dataset can get better results. The pre-trained model is for the celeba not hq. If you want to test the code in celeba-HQ, I think you can retrain. And I am not sure that your mask is correct. I will update the code soon and tell you how to train your own data.

Thanks! And here is my code to generate mask for the face dataset. Could you please help check if this should work? def centerbox(shape): height=shape width=shape mask=np.zeros(( height, width), np.float32) mask[height//4:3height//4, width//4:3width//4]=1. return mask.reshape(mask.shape+(1,)).astype(np.float32)

KumapowerLIU commented 3 years ago

This is not correct, thecorrect is ` if self.opt.mask_type == 'center': self.maskglobal.zero()(shape: 1 256 256) self.mask_global[:, :, int(self.opt.fineSize/4) + self.opt.overlap : int(self.opt.fineSize/2) + int(self.opt.fineSize/4) - self.opt.overlap,\ int(self.opt.fineSize/4) + self.opt.overlap: int(self.opt.fineSize/2) + int(self.opt.fineSize/4) - self.opt.overlap] = 1 self.input_A.narrow(1,0,1).maskedfill(self.mask_global.bool(), 2123.0/255.0 - 1.0) self.input_A.narrow(1,1,1).maskedfill(self.mask_global.bool(), 2104.0/255.0 - 1.0) self.input_A.narrow(1,2,1).maskedfill(self.mask_global.bool(), 2*117.0/255.0 - 1.0)

` opt.fineSize=256 overlap=4

zengxianyu commented 3 years ago

I encountered the same problem

pengyxhack commented 3 years ago

This is not correct, thecorrect is ` if self.opt.mask_type == 'center': self.maskglobal.zero()(shape: 1 256 256) self.mask_global[:, :, int(self.opt.fineSize/4) + self.opt.overlap : int(self.opt.fineSize/2) + int(self.opt.fineSize/4) - self.opt.overlap, int(self.opt.fineSize/4) + self.opt.overlap: int(self.opt.fineSize/2) + int(self.opt.fineSize/4) - self.opt.overlap] = 1 self.input_A.narrow(1,0,1).maskedfill(self.mask_global.bool(), 2_123.0/255.0 - 1.0) self.input_A.narrow(1,1,1).maskedfill(self.mask_global.bool(), 2_104.0/255.0 - 1.0) self.input_A.narrow(1,2,1).maskedfill(self.mask_global.bool(), 2*117.0/255.0 - 1.0)

` opt.fineSize=256 overlap=4

I have a question that might be simple: Why are these numbers being filled instead of zeros?

shoutOutYangJie commented 3 years ago

@wangyx240 Have you get normal results? I have same question. you can find here #20

ZHANG-hengzhi commented 3 years ago

我在训练自己的模型时遇到问题 image 可以帮忙看一下是什么原因吗,非常感谢

codinglin commented 3 years ago

这是不正确的,正确的是` if self.opt.mask_type =='center': self.maskglobal.zero ()(shape:1 256 256) self.mask_global [:,:,int(self.opt.fineSize / 4)+ self.opt.overlap:int(self.opt.fineSize / 2)+ int(self.opt.fineSize / 4)-self.opt.overlap, int(self.opt.fineSize / 4)+ self。 opt.overlap:int(self.opt.fineSize / 2)+ int(self.opt.fineSize / 4)-self.opt.overlap] = 1 self.input_A.narrow(1,0,1).maskedfill(self .mask_global.bool(),2 _123.0 / 255.0-1.0) self.input_A.narrow(1,1,1).maskedfill(self.maskglobal.bool(),2 104.0 / 255.0-1.0) self.input_A.narrow( 1,2,1).maskedfill(self.mask_global.bool(),2 * 117.0 / 255.0-1.0)

` opt.fineSize = 256重叠= 4

您好,那这样生成的mask不就是120120的大小吗?跟论文中的128128不一致