Code Monkey home page Code Monkey logo

infoswap-master's Introduction

InfoSwap: Information Bottleneck Disentanglement for Identity Swapping

License

Copyright (C) 2021, CRIPAC, NLPR, CASIA. All rights reserved. Licensed under the CC BY-NC-SA 4.0 license (https://creativecommons.org/licenses/by-nc-sa/4.0/).

Code usage

Please check out the user manual page.

Paper

Gege Gao, Huaibo Huang, Chaoyou Fu, Zhaoyang Li, Ran He, "Information Bottleneck Disentanglement for Identity Swapping", CVPR 2021

Results Across Large Gaps:

Results of 1024x1024 Pixels:

Results in Film Scenes:

Citation

If you find this code useful for your research, please cite our paper:

@InProceedings{Gao_2021_CVPR,
    author    = {Gao, Gege and Huang, Huaibo and Fu, Chaoyou and Li, Zhaoyang and He, Ran},
    title     = {Information Bottleneck Disentanglement for Identity Swapping},
    booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
    month     = {June},
    year      = {2021},
    pages     = {3404-3413}
}

infoswap-master's People

Contributors

graphdreamer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

infoswap-master's Issues

source-to-target pairs

Hi, thanks for your great work!

For the quantitative results in your work,I have questions about the correspondence of pair frames from source and target videos respectively.

(1) Did you randomly select 10 frames from each video or get the same pairs as FaceShifter?

(2) Could you provide the source-to-target pairs numbers for further fair comparison?

Thanks!

About the encoders, decoders and AII generators

According to the pseudo code "Algorithm 1" in the supp.pdf file, there are 2 pretrained encoders, 3 decoders and 2 AII generators.

For the encoders and decoders, if I only use 1 module and use it several times during the training, I have this error:
RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation
It's OK to copy a encoder as it's pretrained and I do not need to optimize it during training. But for the decoder, I think its not proper to copy it 3 times, as according to my understanding of the algorithm, the three parts should use decoder with the same parameter.

For the AII generator, I think I just need to have two generators with the same structure, just as the cycle gan has two generators. And I can use the Lcyc in line 41 to optimize these two generators together. Is this understanding right?

Experiment environment

hi. I'm implementing training code of this paper. Can you tell me about details of the training environment? (batch size, gpu ...)

训练流程有个问题请教

image
我看38行是禁止了AII的参数更新,40行又恢复了AII的参数更新,是因为在生成Xs_cycle的时候传入到AII中的所有参数都是no_grad的吗?也就是Z_id_Yst也是detach出来的?

An inconsistency of the input of IBLayer

In inference_demo.py, R = encoder.features[i]; while in the forward function of IIB, R = readout_feats[i].
Which should I use for training?
And when I use R = readout_feats[i], Info is really large (5668875) at the beginning of training.

train code

Do you have a plan to release the training code?

model_128_ir_se50.pth

nice work!
Is it convenient to provide the pretrained face recognition model file model_128_ir_se50.pth?

A link failure

Example in preprocessing is invalid, namely test_on_images.ipynb, could you please send it again

Hyperparameter setup

In your experiment setup, you described alpha : beta = 1: 5 for IIB, is that means alpha = 1, beta = 5?

太棒的**了,看源码有个问题

iib.py里面 191行,标准差为什么取的是均值呢?不太懂
m_s = torch.mean(Rs, dim=0) # [C, H, W]
std_s = torch.mean(Rs, dim=0)
Rs_params.append([m_s, std_s])
eps_s = torch.randn(size=Rt.shape).to(Rt.device) * std_s + m_s
feat_t = Rt * (1. - lambda_t) + lambda_t * eps_s
Xt_feats.append(feat_t) # only related with lambda

        m_t = torch.mean(Rt, dim=0)  # [C, H, W]
        std_t = torch.mean(Rt, dim=0)
        Rt_params.append([m_t, std_t])
        eps_t = torch.randn(size=Rs.shape).to(Rs.device) * std_t + m_t
        feat_s = Rs * (1. - lambda_s) + lambda_s * eps_t
        Xs_feats.append(feat_s)  # only related with lambda

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.