Giter VIP home page Giter VIP logo

Comments (4)

knazeri avatar knazeri commented on September 7, 2024

@hi-zhengcheng Honestly, our motivation for filling the hole with 1 was visualization and the ease of use on inference. I don't believe one could expect much difference using 1 or 0. Having said that, when the missing region is filled with 0, then for those regions completely covering the convolution filter the output will be zero and hence the gradient is zero; while in principle convolving 1s results in some gradient for training.

from edge-connect.

hi-zhengcheng avatar hi-zhengcheng commented on September 7, 2024

@knazeri , thanks for your reply.
I have another question about discriminator's input. For example, in InpaintingModel model:

outputs = self(images, edges, masks)
...
dis_input_fake = outputs.detach()
dis_fake, _ = self.discriminator(dis_input_fake)
...
gen_input_fake = outputs
gen_fake, _ = self.discriminator(gen_input_fake)

The outputs represents the fake images created by the generator, and it includes all area(mask area and other area). Then the discriminator guides the generator create the same pixel values like in the ground truth images. I don't know if it's better to let discriminator only guide generator create good pixel values in mask area. Or may be create good pixel values in whole area will help to create good pixel values in mask area.

So my question is, to the discriminator, will it be better to make the input as:

discriminator(outputs * mask + images * (1 - mask))

Could you share some opinions?

from edge-connect.

knazeri avatar knazeri commented on September 7, 2024

@hi-zhengcheng This is what we discussed a lot when first designing the model. In principle, it only makes sense to have the discriminator only discriminate the pixel values in the mask area. However in practice, this makes the discriminator too powerful! One explanation might be that there might be some subtle discontinuity around the edge when merging the output with the ground truth surrounding! The discriminator then learns to pick the edges around the mask border and the learning gets stalled!

We decided to go with the actual output of the generator instead. Also in case you haven't noticed, our generator is also penalized by the perceptual loss on the entire image which makes its output for non-mask areas very similar to the ground truth, and the input to the discriminator is very similar to what you expect!

from edge-connect.

hi-zhengcheng avatar hi-zhengcheng commented on September 7, 2024

@knazeri Thanks for your reply. Great work!

from edge-connect.

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.