Giter VIP home page Giter VIP logo

gaussian-head-avatar's Introduction

Gaussian Head Avatar: Ultra High-fidelity Head Avatar via Dynamic Gaussians

Requirements

  • Create a conda environment.
conda env create -f environment.yaml
pip install --no-index --no-cache-dir pytorch3d -f https://dl.fbaipublicfiles.com/pytorch3d/packaging/wheels/py38_cu113_pyt1120/download.html
pip install kaolin==0.13.0 -f https://nvidia-kaolin.s3.us-east-2.amazonaws.com/torch-1.12.0_cu113.html
  • Install diff-gaussian-rasterization and simple_knn from gaussian-splatting. Note, for rendering 32-channel images, please modify "NUM_CHANNELS 3" to "NUM_CHANNELS 32" in "diff-gaussian-rasterization/cuda_rasterizer/config.h".
cd path/to/gaussian-splatting
# Modify "submodules/diff-gaussian-rasterization/cuda_rasterizer/config.h"
pip install submodules/diff-gaussian-rasterization
pip install submodules/simple-knn

Datasets

We provide instructions for preprocessing NeRSemble dataset:

  • Apply to download NeRSemble dataset and unzip it into "path/to/raw_NeRSemble/".
  • Extract the images, cameras and background for specific identities into a structured dataset "NeRSemble/{id}".
cd preprocess
python preprocess_nersemble.py
  • Remove background using BackgroundMattingV2. Please git clone the code. Download pytorch_resnet101.pth and put it into "path/to/BackgroundMattingV2/assets/". Then run the script we provide "preprocess/remove_background_nersemble.py".
cp preprocess/remove_background_nersemble.py path/to/BackgroundMattingV2/
cd path/to/BackgroundMattingV2
python remove_background_nersemble.py
  • Fit BFM model for head pose and expression coefficients using Multiview-3DMM-Fitting. Please follow the instructions.

We provide a mini demo dataset for checking whether the code is runnable. Note, before downloading it, you must first sign the NeRSemble Terms of Use.

Training

First, edit the config file, for example "config/train_meshhead_N031", and train the geometry guidance model.

python train_meshhead.py --config config/train_meshhead_N031.yaml

Second, edit the config file "config/train_gaussianhead_N031", and train the gaussian head avatar.

python train_gaussianhead.py --config config/train_gaussianhead_N031.yaml

Reenactment

Once the two-stage training is completed, the trained avatar can be reenacted by a sequence of expression coefficients. Please specify the avatar checkpoints and the source data in the config file "config/reenactment_N031.py" and run the reenactment application.

python reenactment.py --config config/reenactment_N031.yaml

Acknowledgement

Part of the code is borrowed from gaussian-splatting.

Citation

@inproceedings{xu2023gaussianheadavatar,
  title={Gaussian Head Avatar: Ultra High-fidelity Head Avatar via Dynamic Gaussians},
  author={Xu, Yuelang and Chen, Benwang and Li, Zhe and Zhang, Hongwen and Wang, Lizhen and Zheng, Zerong and Liu, Yebin},
  booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
  year={2024}
}

gaussian-head-avatar's People

Contributors

yuelangx avatar eltociear 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.