Skip to content
forked from ai-forever/ghost

A new one shot face swap approach for image and video domains

License

Notifications You must be signed in to change notification settings

oracle9i88/ghost

Repository files navigation

sber-swap

Results

Video Swap

Installation

  1. Clone this repository
git clone https://github.com/Danyache/sber-swap.git
cd sber-swap
git submodule init
git submodule update
  1. Install dependent packages
pip install -r requirements.txt
  1. Download weights
sh download_models.sh

Usage

  1. Colab Demo
  2. Face Swap On Video

python inference.py

  1. Face Swap On Image

python inference.py --target_path examples/images/beckham.jpg --image_to_image True

Training

We also provide the training code for face swap model as follows:

  1. Download VGGFace2 Dataset.
  2. Crop and align faces with out detection model.

python preprocess_vgg.py --path_to_dataset ./VggFace2/VGG-Face2/data/preprocess_train --save_path ./VggFace2-crop

  1. Start training.

python train.py

Tips:

  1. For first epochs we suggest not to use eye detection loss
  2. In case of finetuning model you can variate losses coefficients to make result look more like source identity, or vice versa, save features and attributes of target face

About

A new one shot face swap approach for image and video domains

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 41.4%
  • C++ 22.5%
  • Jupyter Notebook 18.2%
  • Cuda 17.4%
  • Shell 0.3%
  • C 0.1%
  • Other 0.1%