Code Monkey home page Code Monkey logo

Comments (10)

phillipi avatar phillipi commented on May 16, 2024 1

This is because the (default) discriminator is a "PatchGAN" (Section 2.2.2 in the paper). This discriminator slides across the generated image, convolutionally, trying to classify if each overlapping 70x70 patch is real or fake. This results in a 30x30 grid of classifier outputs, each corresponding to a different patch in the generated image.

from pix2pix.

kenshinzh avatar kenshinzh commented on May 16, 2024

@phillipi If I want to classify each overlapping a minor patch eg. like 16 x 16 patch is real or fake, should this results in a which size grid of classifier outputs? any formula or hints can provide?

from pix2pix.

phillipi avatar phillipi commented on May 16, 2024

You can use this script to determine the receptive field (e.g., 16 x 16) of a given architecture:
https://github.com/phillipi/pix2pix/blob/master/scripts/receptive_field_sizes.m

I'm not sure what the formula would be for calculating output grid size given desired receptive field. For a given architecture, you can always check the output size by running it on an image and calling out:size() on the output out.

from pix2pix.

kenshinzh avatar kenshinzh commented on May 16, 2024

@phillipi Thank you for you quick response. I am not familiar with the Matlab. Would you please be more specify how can I get the output with the script you provided. Thank you so much.

from pix2pix.

phillipi avatar phillipi commented on May 16, 2024

That script gives you the receptive field of a neuron. The equation to compute the input receptive field size from a given output receptive field size is (for a single convolutional layer):
input_size = (output_size - 1) * stride + kernel_size

You can call this recursively to compute the receptive field sizes across multiple layers.

from pix2pix.

kenshinzh avatar kenshinzh commented on May 16, 2024

@phillipi Thank you for you kind explanation. I am sorry that I didn't define my question well. The problem is when I use 70*70 patch GAN as discriminator in code, the output is not as sharp as what described in the paper in some occasion.
screen shot 2017-06-25 at 1 37 23 pm
This looks good, but my results is not sharp enough as sample

So I wonder maybe the patch GAN size as default code is 70*70 is too large for the discriminator to classify the fake or real. If I want to enhance the sharpness should I enlarge the patch size or decrease the patch size? or any other suggestions ?

from pix2pix.

junyanz avatar junyanz commented on May 16, 2024

@kenshinzh what's your input and output? To produce good colorization results, one needs to map L to ab. Look at Notes on Colorization for more details.

from pix2pix.

kenshinzh avatar kenshinzh commented on May 16, 2024

Actually, my experments is from a B2A direction which is not the color corrections. I just take this B/W for illustration. all the input image is as the demo 256*256

from pix2pix.

phillipi avatar phillipi commented on May 16, 2024

In the colorizations in the paper, we concatenate the predicted ab map with the ground truth L. This has the effect of making the results look nice and crisp since most of the high frequencies are in the L channel. If you just look at the raw predicted ab it tends to look less sharp.

I don't think there is a simple relationship between discriminator patch size and and sharpness. In practice 70x70 usually works pretty well for me, but you could try a few variants to see what works in your application.

from pix2pix.

phillipi avatar phillipi commented on May 16, 2024

from pix2pix.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.