CycleGAN-TensorFlow icon indicating copy to clipboard operation
CycleGAN-TensorFlow copied to clipboard

How to process images of different sizes?

Open Kongsea opened this issue 6 years ago • 11 comments

This repository processes the fixed-size images, however, I need to input and output images of different sizes and make sure that the images remain the same sizes as its original ones. So can it be modified to support this need? And how to modify it? Thank you very much.

Kongsea avatar Mar 01 '18 04:03 Kongsea

Some info here https://github.com/vanhuyz/CycleGAN-TensorFlow/issues/42

ngeorgis avatar Mar 04 '18 03:03 ngeorgis

Thank you. It said the input images need to be squared, however, my images are not. How to process it or modify the code?

Kongsea avatar Mar 05 '18 02:03 Kongsea

Yes, seem that they need to be square images. Not sure if it is an easy modification to change the source to support non-square images. I may try later. In the meantime, maybe scaling or padding could work but that may depend on your application.

ngeorgis avatar Mar 05 '18 04:03 ngeorgis

Thank you. I will try it too.

Kongsea avatar Mar 05 '18 04:03 Kongsea

Have u guys got some results on the non-squared images? I'm working on it too.. @Kongsea @ngeorgis

xymeng16 avatar May 21 '18 19:05 xymeng16

Have you achieved it? @xymeng16

Kongsea avatar May 22 '18 01:05 Kongsea

Well, I try to apply padding and resize the picture before the input but sadly neither showed a good performance(my application is car license plate generation, which has a fixed size and aspect ratio). So I traverse the code and find I need to modify the implementation of some layers in ops.py. I think I will open a PR after finishing it. @Kongsea

xymeng16 avatar May 23 '18 08:05 xymeng16

Look forward to it.

Kongsea avatar May 24 '18 04:05 Kongsea

Just to be clear, is this discussion about "training" on various/bigger image sizes like 512x512 or "evaluating" a model on different sized inputs?

mattchiang-gsp avatar Jun 11 '18 20:06 mattchiang-gsp

@xymeng16 I try to apply the code on PR data generation,too! You can modify the code to process different W and H size plate images.

Zxr1314 avatar Jul 16 '18 09:07 Zxr1314

Hello! Is there anyone solve the problem :input image size over 256 ?such as 512 or higher

XuJ1E avatar May 17 '22 14:05 XuJ1E