Git Product home page Git Product logo

fsgan's Introduction

FSGAN - Official PyTorch Implementation

Teaser Example video face swapping: Barack Obama to Benjamin Netanyahu, Shinzo Abe to Theresa May, and Xi Jinping to Justin Trudeau.

This repository contains the source code for the video face swapping and face reenactment method described in the paper:

FSGAN: Subject Agnostic Face Swapping and Reenactment
International Conference on Computer Vision (ICCV), Seoul, Korea, 2019
Yuval Nirkin, Yosi Keller, Tal Hassner
Paper   Video

Abstract: We present Face Swapping GAN (FSGAN) for face swapping and reenactment. Unlike previous work, FSGAN is subject agnostic and can be applied to pairs of faces without requiring training on those faces. To this end, we describe a number of technical contributions. We derive a novel recurrent neural network (RNN)–based approach for face reenactment which adjusts for both pose and expression variations and can be applied to a single image or a video sequence. For video sequences, we introduce continuous interpolation of the face views based on reenactment, Delaunay Triangulation, and barycentric coordinates. Occluded face regions are handled by a face completion network. Finally, we use a face blending network for seamless blending of the two faces while preserving target skin color and lighting conditions. This network uses a novel Poisson blending loss which combines Poisson optimization with perceptual loss. We compare our approach to existing state-of-the-art systems and show our results to be both qualitatively and quantitatively superior.

Important note

THE METHODS PROVIDED IN THIS REPOSITORY ARE NOT TO BE USED FOR MALICIOUS OR INAPPROPRIATE USE CASES.
We release this code in order to help facilitate research of technical counter-measures for detecting this kind of forgeries. Suppressing this kind of publications will not stop their development but will only make it more difficult to detect them.

Please note this is a work in progress, while we make every effort to improve the results of this method, not every pair of faces can produce a high quality face swap.

Requirements

  • High-end NVIDIA GPUs with at least 11GB of DRAM.
  • Either Linux or Windows. We recommend Linux for better performance.
  • CUDA Toolkit 10.1, CUDNN 7.5, and the latest NVIDIA driver.
  • Python 3.6+ and PyTorch 1.4.0+.

Installation

For accessing FSGAN's pretrained models and auxiliary data, please fill out this form. We will then send you a link to FSGAN's shared directory and download script.

Inference

Training

TBD

Citation

@inproceedings{nirkin2019fsgan,
  title={{FSGAN}: Subject agnostic face swapping and reenactment},
  author={Nirkin, Yuval and Keller, Yosi and Hassner, Tal},
  booktitle={Proceedings of the IEEE International Conference on Computer Vision},
  pages={7184--7193},
  year={2019}
}

fsgan's People

Contributors

sajjadaemmi avatar yuvalnirkin avatar

Watchers

 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.