Giter VIP home page Giter VIP logo

Comments (6)

bes-dev avatar bes-dev commented on July 24, 2024 1

@RahulBhalley our code doesn't load pre-trained student automatically, you should load it on your side. Please, look at this sample of code:

if args.ckpt != "":

from mobilestylegan.pytorch.

bes-dev avatar bes-dev commented on July 24, 2024

@RahulBhalley did you load pre-trained checkpoint?

from mobilestylegan.pytorch.

RahulBhalley avatar RahulBhalley commented on July 24, 2024

@bes-dev after running the following lines of code

cfg = load_cfg("configs/mobile_stylegan_ffhq.json")
distiller = Distiller(cfg)

I get the following output.

load mapping network...
load pretrained model: stylegan2_ffhq_config_f_mapping_network.ckpt...
Computing MD5: /tmp/stylegan2_ffhq_config_f_mapping_network.ckpt
MD5 matches: /tmp/stylegan2_ffhq_config_f_mapping_network.ckpt
load synthesis network...
load pretrained model: stylegan2_ffhq_config_f_synthesis_network.ckpt...
Computing MD5: /tmp/stylegan2_ffhq_config_f_synthesis_network.ckpt
MD5 matches: /tmp/stylegan2_ffhq_config_f_synthesis_network.ckpt
/Users/codeboy/Freelancing/SocialKit/face-app/restyle-encoder-light/venv/lib/python3.9/site-packages/torchvision/models/inception.py:80: FutureWarning: The default weight initialization of inception_v3 will be changed in future releases of torchvision. If you wish to keep the old behavior (which leads to long initialization times due to scipy/scipy#11299), please set init_weights=True.
  warnings.warn('The default weight initialization of inception_v3 will be changed in future releases of '

It looks like the checkpoints are loaded (for mapping_net also).

from mobilestylegan.pytorch.

RahulBhalley avatar RahulBhalley commented on July 24, 2024

I tried using distiller.style_mean but still I get gray image.

out = distiller.student(distiller.style_mean)['img']

from mobilestylegan.pytorch.

RahulBhalley avatar RahulBhalley commented on July 24, 2024

Even truncation trick doesn't produce face image (but just gray).

var = torch.randn(1, 512)
style = distiller.mapping_net(var)
style = distiller.style_mean + 0.5 * (style - distiller.style_mean)
out = distiller.student(style)['img']

from mobilestylegan.pytorch.

RahulBhalley avatar RahulBhalley commented on July 24, 2024

Brilliant! Dumb me. 😅 I forgot looking at demo code. Thank you! 🙏

style_mean

from mobilestylegan.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.