Code Monkey home page Code Monkey logo

Comments (8)

gooobot avatar gooobot commented on May 4, 2024 1

I think the multi scale input may not be produced by resize, it's produced from every to_rbg layer like https://github.com/JiauZhang/GigaGAN/blob/main/model.py#L254

from gigagan-pytorch.

potato123-hash avatar potato123-hash commented on May 4, 2024 1

@gooobot ohh got it! so the generator will need to output all the rgb at all stages, and be able to pass it into the discriminator. i can get that done tomorrow morning, thank you! 🙏
if a real image taken from the dataset is fed into the discriminator, then it would be resized as the code does now?

Yes, the generator will output images with [4x, 8x, ..., 32x, 64x] resolution when use_multi_scale is enabled.

That's what I mean! @lucidrains Thank you for you great effort!

from gigagan-pytorch.

lucidrains avatar lucidrains commented on May 4, 2024

@potato123-hash hello! so i'm actually doing that automatically here. let me know if i misunderstood that part of the paper

from gigagan-pytorch.

lucidrains avatar lucidrains commented on May 4, 2024

@gooobot ohh got it! so the generator will need to output all the rgb at all stages, and be able to pass it into the discriminator. i can get that done tomorrow morning, thank you! 🙏

if a real image taken from the dataset is fed into the discriminator, then it would be resized as the code does now?

from gigagan-pytorch.

gooobot avatar gooobot commented on May 4, 2024

@gooobot ohh got it! so the generator will need to output all the rgb at all stages, and be able to pass it into the discriminator. i can get that done tomorrow morning, thank you! 🙏

if a real image taken from the dataset is fed into the discriminator, then it would be resized as the code does now?

Yes, the generator will output images with [4x, 8x, ..., 32x, 64x] resolution when use_multi_scale is enabled.

from gigagan-pytorch.

lucidrains avatar lucidrains commented on May 4, 2024

@potato123-hash @gooobot ok, makes sense! will get this all fixed tomorrow! thank you for raising this issue

from gigagan-pytorch.

lucidrains avatar lucidrains commented on May 4, 2024

@potato123-hash do you want to try 0.0.16 and see if that fits your intuition?

import torch
from gigagan_pytorch.gigagan_pytorch import (
    TextEncoder,
    Generator,
    Discriminator,
    StyleNetwork
)

text_encoder = TextEncoder(
    dim = 512,
    depth = 2
).cuda()

discr = Discriminator(
    dim = 64,
    dim_max = 512,
    image_size = 256,
    text_encoder = text_encoder,
    use_glu = True,
    num_skip_layers_excite = 4,
    unconditional = False
).cuda()

style_network = StyleNetwork(
    dim = 64,
    depth = 4,
    dim_text_latent = text_encoder.dim
).cuda()

generator = Generator(
    dim = 64,
    style_network = style_network,
    text_encoder = text_encoder,
    image_size = 256,
    dim_max = 512,
    use_glu = True,
    num_skip_layers_excite = 4
).cuda()

# mock data

real_images = torch.randn(1, 3, 256, 256).cuda()
texts = ['a happy dog wagging her tail']

# generator

image, rgbs = generator(
    texts = texts,
    batch_size = 1,
    return_all_rgbs = True
)

# discriminator

logits, *_ = discr(
    image,
    rgbs,
    real_images = real_images,
    texts = texts
)

from gigagan-pytorch.

lucidrains avatar lucidrains commented on May 4, 2024

feel free to reopen if it isn't resolved!

from gigagan-pytorch.

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.