This repository contains the official PyTorch implementation of the paper Designing One Unified Framework for High-Fidelity Face Reenactment and Swapping (ECCV2022).
conda create -y -n uniface python=3.6.12
conda activate uniface
./install.sh
Please download CelebA-HQ in data
.
Please download VoxCeleb2 in data
and follow the instrcution in FOMM official repository to perform preprocessing.
Please put test images to examples
and create pair.txt
to indicate the source and target file names. For example, 001_002
means the source file name is 001
and the target is 002
.
Please put pre-trained models in session
. We release the separately trained models reenact and swap, the unified one will be available soon after we open source the journal version.
git clone https://github.com/xc-csc101/UniFace
python generate_swap.py # test for swapping
python generate_reenact.py # test for reenactment
python train_reenact.py # train for reenactment
python train_swap.py # train for swapping
Our project is built on the StyleMapGAN and some codes are borrowed from pSp. We thank the authors for their excellent work.