Skip to content

Latest commit

 

History

History
52 lines (43 loc) · 1.44 KB

README.md

File metadata and controls

52 lines (43 loc) · 1.44 KB

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