Giter Site home page Giter Site logo

x2face's Introduction

This repository contains the code for X2Face, presented at ECCV 2018.

Demo Files for Trained Models

The demo notebooks demonstrate the following:

  • How to load the pre-trained models
  • How to drive a face with another face in ./UnwrapMosaic/Face2Face_UnwrapMosaic.ipynb
  • How to edit the embedded face with a drawing or tattoo in ./UnwrapMosaic/Face2Face_UnwrapMosaic.ipynb
  • How to drive with pose in ./UnwrapMosaic/Pose2Face.ipynb
  • How to drive with audio in ./UnwrapMosiac/Audio2Face.ipynb

Update: We have added updated code and installation instructions to run the demo notebooks with pytorch 0.4.1 and python 2.7 in the branch 'pytorch_0.4.1' and for pytorch 0.4.1 and python 3.7 in the branch 'py37_pytorch_0.4.1'.

To run the notebooks, you need:

  • pytorch=0.2.0_4
  • torchvision
  • PIL
  • numpy
  • matplotlib

It is important to use the right version of pytorch, as the defaults for sampling and some other things have changed in more recent versions of pytorch. In these cases, the pretrained models will not work properly.

Once the environment is set up, the pre-trained models can be downloaded from the project page and the model paths in the notebooks updated appropriately (this should simply require setting the BASE_MODEL_PATH in the notebook to the correct location).

If you find this useful in your work, please cite the paper appropriately.

Training

Training code requires:

  • tensorboardX

To train a model yourself, we have given an example training file using only the photometric loss. To run this:

  • Go to the website
  • In the data section download the images and training/testing splits
  • Update the paths in ./UnwrapMosaic/VoxCelebData_withmask.py
  • Run the code with python train_model.py --results_folder $WHERE_TO_SAVE_TENSORBOARD_FILES --model_epoch_path $WHERETOSAVEMODELS

(Note that this can be run with any version of pytorch -- it is merely important that you train/test with the same version.)

x2face's People

Contributors

oawiles avatar

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.