GithubHelp home page GithubHelp logo

Comments (19)

AK391 avatar AK391 commented on July 25, 2024 3

@williamyang1991 web demo was added (https://huggingface.co/spaces/hysts/DualStyleGAN) by https://huggingface.co/hysts on huggingface, made a PR to link it #3

from dualstylegan.

hysts avatar hysts commented on July 25, 2024 3

@williamyang1991

Hi, awesome work!

I wrote the code for the web demo, and happened to find this issue, so I added the style image table you provided. Thank you.

from dualstylegan.

hysts avatar hysts commented on July 25, 2024 3

@williamyang1991
Cool! Thank you very much! I updated the web demo.

from dualstylegan.

williamyang1991 avatar williamyang1991 commented on July 25, 2024 2

@hysts
I saw the bar to adjust the weights for more flexible style transfer was also added.
Great job! Thank you very much for this awesome web demo!

from dualstylegan.

AK391 avatar AK391 commented on July 25, 2024 1

@williamyang1991 thanks the demo was setup by a community member: https://huggingface.co/hysts, it was recently updated to add the table

from dualstylegan.

hysts avatar hysts commented on July 25, 2024 1

@AK391
Well, I wasn't planning to do it, but I can.
But the problem is that style images for other style types are not provided, so we'll have the same issue as #4.

@williamyang1991
Is it possible for you to provide style image tables like the one in #2 (comment) for other style types?

from dualstylegan.

AK391 avatar AK391 commented on July 25, 2024

@williamyang1991 also could there be a option in colab to use cpu for inference?

from dualstylegan.

williamyang1991 avatar williamyang1991 commented on July 25, 2024

@williamyang1991 web demo was added (https://huggingface.co/spaces/hysts/DualStyleGAN) by https://huggingface.co/hysts on huggingface, made a PR to link it #3

Thank you for the impressive web demo!

@williamyang1991 also could there be a option in colab to use cpu for inference?

I will modify it when I have free time.

from dualstylegan.

williamyang1991 avatar williamyang1991 commented on July 25, 2024

Hi, @AK391, it seems that there is an issue on your impressive web demo: #4 (comment)

I think it will be great if you can kindly add the style overview below to the web demo,
so that users could visually browse the styles for esay use. :)

cartoon_overview

from dualstylegan.

williamyang1991 avatar williamyang1991 commented on July 25, 2024

@williamyang1991 also could there be a option in colab to use cpu for inference?

Hi, @AK391 , I modified the code and successfully ran the notebook on CPU following the intruction in ReadMe:

If no GPU is available, you may refer to Inference on CPU, and set device = 'cpu' in the notebook.

from dualstylegan.

AK391 avatar AK391 commented on July 25, 2024

@hysts thanks for setting up the demo, looks great, are there plans to add the other styles for example arcane, anime, slam dunk?

from dualstylegan.

williamyang1991 avatar williamyang1991 commented on July 25, 2024

@hysts
Part of the style images we used are collected from the Internet like Slam Dunk, Arcane and Pixar.
I'm not sure if we can release them without acquiring the corresponding copyrights.
If we just need a style table for style reference, maybe I can generate a style table from the reconstructed style images?
These images are generated from the instrinsic and extrinsic style codes of the original style image via our network.
These free copyright generated images should look like the original ones and are enough to help users visually browse the styles.

from dualstylegan.

hysts avatar hysts commented on July 25, 2024

@williamyang1991

I see.

If we just need a style table for style reference, maybe I can generate a style table from the reconstructed style images?

I think that would work.

By the way, I updated the web demo to include other styles, currently without the reference style images except cartoon.

from dualstylegan.

williamyang1991 avatar williamyang1991 commented on July 25, 2024

@hysts
I have uploaded style tables here.

Cartoon, Caricature and Anime are built from public datasets, so I use the original images.
Other styles use the generated images (see Reconstruction in the filenames).

from dualstylegan.

AK391 avatar AK391 commented on July 25, 2024

@hysts just saw that the demo is down, can you restart it by going to settings -> restart button?

from dualstylegan.

hysts avatar hysts commented on July 25, 2024

@AK391
Thank you for letting me know. I just restarted it.
Looks like it's out of memory, but I wonder why that happens.

  File "/home/user/.local/lib/python3.8/site-packages/gradio/routes.py", line 265, in predict
    output = await run_in_threadpool(app.launchable.process_api, body, username)
  File "/home/user/.local/lib/python3.8/site-packages/starlette/concurrency.py", line 39, in run_in_threadpool
    return await anyio.to_thread.run_sync(func, *args)
  File "/home/user/.local/lib/python3.8/site-packages/anyio/to_thread.py", line 28, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(func, *args, cancellable=cancellable,
  File "/home/user/.local/lib/python3.8/site-packages/anyio/_backends/_asyncio.py", line 818, in run_sync_in_worker_thread
    return await future
  File "/home/user/.local/lib/python3.8/site-packages/anyio/_backends/_asyncio.py", line 754, in run
    result = context.run(func, *args)
  File "/home/user/.local/lib/python3.8/site-packages/gradio/interface.py", line 573, in process_api
    prediction, durations = self.process(raw_input)
  File "/home/user/.local/lib/python3.8/site-packages/gradio/interface.py", line 615, in process
    predictions, durations = self.run_prediction(
  File "/home/user/.local/lib/python3.8/site-packages/gradio/interface.py", line 531, in run_prediction
    prediction = predict_fn(*processed_input)
  File "/home/user/.local/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
    return func(*args, **kwargs)
  File "app.py", line 175, in run
    img_rec, instyle = encoder(input_data,
  File "/home/user/.local/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl
    return forward_call(*input, **kwargs)
  File "DualStyleGAN/model/encoder/psp.py", line 97, in forward
    images, result_latent = self.decoder([codes],
  File "/home/user/.local/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl
    return forward_call(*input, **kwargs)
  File "DualStyleGAN/model/stylegan/model.py", line 573, in forward
    out = conv1(out, latent[:, i], noise=noise1)
  File "/home/user/.local/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl
    return forward_call(*input, **kwargs)
  File "DualStyleGAN/model/stylegan/model.py", line 363, in forward
    out = self.conv(input, style, externalweight)
  File "/home/user/.local/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl
    return forward_call(*input, **kwargs)
  File "DualStyleGAN/model/stylegan/model.py", line 284, in forward
    out = self.blur(out)
  File "/home/user/.local/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl
    return forward_call(*input, **kwargs)
  File "DualStyleGAN/model/stylegan/model.py", line 88, in forward
    out = upfirdn2d(input, self.kernel, pad=self.pad)
  File "DualStyleGAN/model/stylegan/op/upfirdn2d.py", line 152, in upfirdn2d
    out = upfirdn2d_native(input, kernel, *up, *down, *pad)
  File "DualStyleGAN/model/stylegan/op/upfirdn2d.py", line 188, in upfirdn2d_native
    out = F.conv2d(out, w)
RuntimeError: [enforce fail at alloc_cpu.cpp:73] . DefaultCPUAllocator: can't allocate memory: you tried to allocate 1073741824 bytes. Error code 12 (Cannot allocate memory)

libgomp: Thread creation failed: Resource temporarily unavailable

from dualstylegan.

AK391 avatar AK391 commented on July 25, 2024

@williamyang1991 tagging about the memory issue and @hysts there is another error now RuntimeError: can't start new thread

edit: it is back up now

from dualstylegan.

williamyang1991 avatar williamyang1991 commented on July 25, 2024

@AK391 Not sure what causes the memory issue.
My testing code only runs two feed-forward processes with a maximum batch size of two.
I don't think it will use so much memory.

I'm not familiar with the technical implementation of the web demo.
Will the demo release the memory after every inference? There are 7 models for 7 styles. Will they be all loaded into the memory?

from dualstylegan.

hysts avatar hysts commented on July 25, 2024

@AK391 @williamyang1991

I'm not sure, but I guess it was just a temporary glitch in the environment of Hugging Face Spaces because I did nothing but it's back up now. Also, the app worked just fine in my local environments (mac and ubuntu), and in a GCP environment with 4 CPUs and 16 GB RAM, while the document of hf spaces says

Each Spaces environment is limited to 16GB RAM and 8 CPU cores.

from dualstylegan.

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.