yenchenlin / pix2pix-tensorflow

TensorFlow implementation of "Image-to-Image Translation Using Conditional Adversarial Networks".
MIT License
939 stars 300 forks source link

controlling patch size #11

Open eyaler opened 7 years ago

eyaler commented 7 years ago

can we allow controlling the patch size explicitly?

philokey commented 7 years ago

@eyaler I also have the same question, do you solve it?

evolu8 commented 7 years ago

Any movement on this?

danmic commented 7 years ago

At the moment, is it a 70x70 discriminator as described in the paper?

qixiang109 commented 6 years ago

The same question. Does a 4-layer 4-spatial filter 2-strides convolution naturally leads to a 70*70 patch discriminator?

emilwallner commented 6 years ago

Here is visualizer to understand how it works: https://fomoro.com/tools/receptive-fields/#

Explained here: https://github.com/junyanz/pytorch-CycleGAN-and-pix2pix/issues/39

Below is a python script to play around with:

def f(output_size, ksize, stride):
    return (output_size - 1) * stride + ksize

last_layer = f(output_size=1, ksize=4, stride=1)
# Receptive field: 4
fourth_layer = f(output_size=last_layer, ksize=4, stride=1)
# Receptive field: 7
third_layer = f(output_size=fourth_layer, ksize=4, stride=2)
# Receptive field: 16
second_layer = f(output_size=third_layer, ksize=4, stride=2)
# Receptive field: 34
first_layer = f(output_size=second_layer, ksize=4, stride=2)
# Receptive field: 70

print(first_layer)
litingfeng commented 5 years ago

@emilwallner Hello, I think that in the python code, the comment should be input size rather than receptive field. As that in the visualizer link, where there are input size, output size, and receptive field.

taggyhan commented 1 year ago

has anyone found out how to control the patch-size in the discriminator from Nlayerdiscriminator?

camellia1137373272733838 commented 6 months ago

Is there any movement?