PF-AFN icon indicating copy to clipboard operation
PF-AFN copied to clipboard

How to get output on custom images?

Open anushkayadav opened this issue 3 years ago • 3 comments

On any custom dimensional image, I get this error.

Traceback (most recent call last): File "test.py", line 50, in <module> flow_out = warp_model(real_image.cuda(), clothes.cuda()) File "C:\Users\sjasu\anaconda3\envs\fyp\lib\site-packages\torch\nn\modules\module.py", line 727, in _call_impl result = self.forward(*input, **kwargs) File "C:\Users\sjasu\Projects\fyp\PF-AFN\PF-AFN_test\models\afwm.py", line 192, in forward cond_pyramids = self.cond_FPN(self.cond_features(cond_input)) # maybe use nn.Sequential File "C:\Users\sjasu\anaconda3\envs\fyp\lib\site-packages\torch\nn\modules\module.py", line 727, in _call_impl result = self.forward(*input, **kwargs) File "C:\Users\sjasu\Projects\fyp\PF-AFN\PF-AFN_test\models\afwm.py", line 103, in forward feature = feature + F.interpolate(last_feature, scale_factor=2, mode='nearest') RuntimeError: The size of tensor a (175) must match the size of tensor b (176) at non-singleton dimension 2

I tried to solve this by resizing the image to multiple of 192 x 256. Here I resized to 384 x 512, this is the output I am getting .. image

anushkayadav avatar Apr 12 '21 19:04 anushkayadav

The provided model is trained on images of 192 x 256. You can try to resize the image to 192 x 256.

geyuying avatar Apr 13 '21 01:04 geyuying

If i want to trian the model with high resolution,shall i change the network's input or output?

amandazw avatar Apr 14 '21 09:04 amandazw

@geyuying Then how did you obtain output for VITON-HD dataset? Also, should the background of the image be always white?

anushkayadav avatar Apr 25 '21 10:04 anushkayadav