cryu854 / FastStyle

Fast-Style-Transfer in TensorFlow 2 :art:
MIT License
38 stars 15 forks source link

Cannot transfer the style on any arbitrary size image while inference #2

Open KushGabani opened 3 years ago

KushGabani commented 3 years ago

When I try to evaluate the model with the content image provided, If I set load_image(content, resize=False) then there's an error that says the sizes of input doesn't match with the model's input. The model needs an (1, 256, 256, 3) image that it is trained on. But if I allow resizing load_image(content, resize=True), it works but the image has low resolution. And the photos in your read me are high res, how did you allow arbitrary image size into the model?

cryu854 commented 3 years ago

Only at training phase needs to specify the image size because it uses a VGG network to extract features. After training is complete, you can transfer images of arbitrary size. BTW, transfer network doesn't need to specify input shape. so I think it won't cause any mismatch problem.