Giter Site home page Giter Site logo

ken2576 / pvp Goto Github PK

View Code? Open in Web Editor NEW
7.0 3.0 1.0 30 KB

Official PyTorch Implementation of paper "PVP: Personalized Video Prior for Editable Dynamic Portraits using StyleGAN", EGSR 2023.

License: MIT License

Python 100.00%

pvp's Introduction

PVP: Personalized Video Prior for Editable Dynamic Portraits using StyleGAN

Requirements

Install dependencies.

conda create -n pvp python=3.9

pip install torch==1.12.1+cu113 torchvision==0.13.1+cu113 torchaudio==0.12.1 --extra-index-url https://download.pytorch.org/whl/cu113

conda install hydra-core hydra-colorlog hydra-optuna-sweeper tqdm pytorch-lightning==1.8.1 torchmetrics kornia==0.6.7 scipy scikit-image

conda install bottler nvidiacub

pip install timm tensorboardX blobfile gpustat torchinfo fairseq==0.10.0 click einops safetensors chumpy face_alignment

pip install git+https://github.com/facebookresearch/pytorch3d.git

conda activate pvp

Download the following and put them in ./assets

Path Description
FFHQ StyleGAN StyleGAN2-ada model trained on FFHQ with 1024x1024 output resolution.
ArcFace ArcFace model for identity loss.

Data Preprocessing

Run NHA preprocessing to generate poses

See NHA

Run masking to generate masked data

python make_masked_images.py --folder [nha processed data]

Extract FLAME data for each frame with DECA

python extract_expr_cli.py --folder [nha processed data]

Generate key frames for PTI

python make_keyframes_expr.py --folder [nha processed data] --out_folder [keyframe folder] --n_cluster 200 --n_sample 1 --val_start [validation frame start]

Run PTI on the data

python -m scripts.run_pti --input_data_path [keyframe folder] --input_data_id [name] --experiments_output_dir [PTI output folder]

Training

Set up the configs (train.yaml), and replace paths starting with /home/ken with your own paths.

Change train_size and test_size in train.yaml to your desired sizes. Default train_size=750 means the first 750 frames will be used as training data. test_size=700 means frame 751 to 1450 will be used as test data.

Run python train.py --config-name=train name="[your experiment name]"

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.