Open wangyx240 opened 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.
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)
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
I encountered the same problem
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?
@wangyx240 Have you get normal results? I have same question. you can find here #20
我在训练自己的模型时遇到问题 可以帮忙看一下是什么原因吗,非常感谢
这是不正确的,正确的是` 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不一致
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!