junyanz / CycleGAN

Software that can generate photos from paintings, turn horses into zebras, perform style transfer, and more.
Other
12.23k stars 1.93k forks source link

base_options.py '--loadSize', '--fineSize', and '--resize_or_crop' #61

Closed Ai-is-light closed 6 years ago

Ai-is-light commented 6 years ago

I met some confusion about the setting in base_options.py , as the setting about the '--loadSize', '--fineSize', and '--resize_or_crop'. Firstly, I would like to know how did you get these parameters, and why did you set then as that. And, then , if I don't follow your default setting, there are someone saying that the model couldn't work as well as you, why? Because of coding of " transforms.RandomCrop(opt.fineSize) ", when I run the test.py for producing large number of images for low-quality image recognition, even though I just input ONE image, BUT, the results are different for THIS ONE input everytime. How can I deal with it. Thanks for your attention and your great work.

junyanz commented 6 years ago

Thanks for your questions. The program first resizes the images to the size of (loadSize, loadSize) and then crop the fineSize*fineSize patches in random positions. This is a commonly used data argumentation trick to prevent the overfitting in network training. --resize_or_crop implements other more advanced cropping and resizing policy.

To test the program, you can either fix the seed in the random number generator or set loadSize and fineSize as the same size.

Ai-is-light commented 6 years ago

@junyanz thanks for you and your excellent work