Giter VIP home page Giter VIP logo

Comments (7)

williamyang1991 avatar williamyang1991 commented on June 8, 2024 1

Maybe your image contains the alpha channel, i.e., RGBA channels, while our code works on RGB channels. So there is a mismatch in the channel dimension (4 v.s. 3).
In addtion, the length and width of the image need to be a multiple of 8. For example, 255*255 should be resized to 256*256.
Or you can provide me with a link of your image and I will check it.

from shapematchinggan.

williamyang1991 avatar williamyang1991 commented on June 8, 2024

I just used Photoshop. It is easy to use and the user can control where to be used as foreground.

from shapematchinggan.

noobiecoder1942 avatar noobiecoder1942 commented on June 8, 2024

Thank you for such a quick response. I am trying to train the model on a different dataset but I have no background in photoshop. Can you please suggest steps you followed to convert the text data used in TET-GAN paper to data used in this paper? Any steps or reference link would be really helpful!

from shapematchinggan.

williamyang1991 avatar williamyang1991 commented on June 8, 2024

For a new style image, you may refer to the magic wand tool in photoshop (https://www.photoshopessentials.com/basics/selections/magic-wand-tool/)
to select its foreground. Then you fill the foreground with white and the remain region with black.
Next, use utils.text_image_preprocessing to transform black and white mask into distance-based mask (the blue and red one).
FInally, concatenate distance-based mask with your style image as the format of images in ../data/style/ and copy the result to ../data/style/.
Hope this help.

from shapematchinggan.

Drod917 avatar Drod917 commented on June 8, 2024

@williamyang1991 Thank you for this awesome project! I've followed these instructions and have obtained an image in the same format as the those in ../data/style/ (distance map on the left, original style reference on the right) and the network nearly makes it through the first epoch before throwing

"RuntimeError: The size of tensor a (256) must match the size of tensor b (255) at non-singleton dimension 1"

I'm almost certain it has to do with the way I may be formatting the image, but I'm unsure. Any ideas?

from shapematchinggan.

Drod917 avatar Drod917 commented on June 8, 2024

Changing the length & width of my image to multiples of 8 fixed the problem. Thank you!

from shapematchinggan.

noobiecoder1942 avatar noobiecoder1942 commented on June 8, 2024

That was really helpful! Thanks for the Photoshop instructions!

from shapematchinggan.

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.