Git Product home page Git Product logo

Comments (11)

threefoldo avatar threefoldo commented on May 22, 2024 2

These warnings are irrelevant. To improve the image quality, you can enable 'use_sr' option which will call face_enhancement. However, the pix2pix super resolution is not good, I'm working on an alternative model.

from ghost.

epicstar7 avatar epicstar7 commented on May 22, 2024

There are also 2 errors shown, maybe this gives a clue:

sberswap\lib\site-packages\torch\nn\functional.py:3000: UserWarning: The default behavior for interpolate/upsample with float scale_factor changed in 1.6.0 to align with other frameworks/libraries, and uses scale_factor directly, instead of relying on the computed output size. If you wish to keep the old behavior, please set recompute_scale_factor=True. See the documentation of nn.Upsample for details. warnings.warn("The default behavior for interpolate/upsample with float scale_factor changed "

and

sberswap\lib\site-packages\kornia\augmentation\augmentation.py:1833: DeprecationWarning: GaussianBlur is no longer maintained and will be removed from the future versions. Please use RandomGaussianBlur instead. category=DeprecationWarning,

from ghost.

epicstar7 avatar epicstar7 commented on May 22, 2024

I tried use_sr but it didn't make a huge difference. Still somewhat blurry and suboptimal.

What alternative model are you looking at, something like GPEN/GFPGAN?

from ghost.

AlexanderGroshev avatar AlexanderGroshev commented on May 22, 2024

Hi, @epicstar7! The output face may look blurry because our model only generates a 256x256 resolution. To solve this problem, you can look at the face enhancement function. If you need a stronger super resolution model, check out sber-swap implementation with the GFPGAN sr model SberSwapInferenceGFPGAN.ipynb. It scales the output images up to 512x512 and the faces look more detailed. However, in this case, the inference time is longer.

from ghost.

epicstar7 avatar epicstar7 commented on May 22, 2024

Thanks a lot @AlexanderGroshev, let me try it. Is there a way to run this code from the conda commandline instead of a ipynb script file? I'm not really sure how to translate it to the right commands on there.

from ghost.

AlexanderGroshev avatar AlexanderGroshev commented on May 22, 2024

@epicstar7 check inference_GFPGAN.py:

python inference_GFPGAN.py --source_paths examples/images/beckham.jpg --target_video examples/videos/nggyup.mp4 --use_sr True

You need to clone GFPGAN repository, download weights GFPGANCleanv1-NoCE-C2.pth and place to GFPGAN/experiments/pretrained_models/ folder

from ghost.

epicstar7 avatar epicstar7 commented on May 22, 2024

This works mate, amazing job, this is a great improvement to this repo. Thanks!

from ghost.

epicstar7 avatar epicstar7 commented on May 22, 2024

I do get an error CUDA out of memory when trying to swap on video. I'm curious to know why this happens for videos while for single images there is no issue. This shouldn't happen right?

from ghost.

AlexanderGroshev avatar AlexanderGroshev commented on May 22, 2024

@epicstar7, try to reduce batch size, it might help.

from ghost.

epicstar7 avatar epicstar7 commented on May 22, 2024

This works, changed it with -batch_size 16 and now no CUDA memory error any more. But the face is not swapped in the output video!

from ghost.

epicstar7 avatar epicstar7 commented on May 22, 2024

Managed to get it working using a targetimage of the face. I noticed though swapping is sometimes failing after just a few frames in the video. You see the swapped face for a few frames and then it just returns to the original pictures. Any thoughts why this happens?

from ghost.

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.