Code Monkey home page Code Monkey logo

nerfblendshape-unofficial's Introduction

NeRFBlendShape Unofficial Implementation

This is an UNOFFICIAL implementation of the paper "Reconstructing Personalized Semantic Facial NeRF Models From Monocular Video". The authors released the inference code here, while we implements the training part according to the paper in this repo. Besides, we train a torso net based on RAD-NeRF. The performance of this implementation may differ from the original paper. An example test result can be found from data/example.mp4

Usage notice

This implementation relies on a private blendshape extractor which can not be open-source, so you could try using the FaceWarehouse from the original paper or using other blendshape basis like BFM2009. This repo -> (https://github.com/sicxu/Deep3DFaceRecon_pytorch) may help.

Data preparation

  1. Prepare some model weights according to here (Data pre-processing/preparation part).

  2. Put the video under {data/vids} and run python data_utils/process.py VIDEO_NAME

  3. We extract blendshapes and saving as files to data/CORRESPONDING_DATASET_NAME/, including expr.npy, expr_max.npy, expr_min.npy. The first one contains an array whose shape is [image_num_from_dataset, expression_blendshape_dim]. And the latter two contrain the maximum and the minimum expression caculated from the the first one. You could extract blendshapes using your extractor and saving as the similar format.

Training

# train head part
python main_nerf.py data/DATASET_NAME --workspace EXPERIMENT_FILE_PATH --test_fps 25 --network blend4_noamb --use_patch_loss --patch_size 32 --train_epoch 15 --downscale 1 --cuda_ray --preload 2 --test_num 500 --expr_dim {expression_blendshape_dim} --update_extra_interval 1000 --fp16

# train torso part
python main_nerf.py data/DATASET_NAME --workspace EXPERIMENT_FILE_PATH --test_fps 25 --network blend4_noamb --use_patch_loss --patch_size 32 --train_epoch 15 --downscale 1 --cuda_ray --preload 2 --test_num 500 --expr_dim {expression_blendshape_dim}  --update_extra_interval 1000 --fp16 --torso --head_ckpt OUTPUT_PTH_FILE_PATH_FROM_FIRST_STEP

Testing

python main_nerf.py data/DATASET_NAME --workspace EXPERIMENT_FILE_PATH --test_fps 25 --network blend4_noamb --use_patch_loss --patch_size 32 --train_epoch 15 --downscale 1 --cuda_ray --preload 2 --test_num 500 --expr_dim {expression_blendshape_dim} --update_extra_interval 1000 --fp16 --torso --head_ckpt OUTPUT_PTH_FILE_PATH_FROM_FIRST_STEP --test

Acknowledgement

Else

Give this repo a star if it helps you!

nerfblendshape-unofficial's People

Contributors

flyingshan avatar

Stargazers

 avatar Zhenhui Ye avatar  avatar Dylan_邓珺礼 avatar chiehwangs avatar  avatar  avatar YiChenCityU avatar Zard avatar T_T avatar  avatar

Watchers

 avatar

nerfblendshape-unofficial's Issues

眨眼的时候画面会抖动

您好,我在测试训练好的模型时,在不说话的时候如果眨眼,人脸图像会闪一下,请问您有遇到这个问题吗?

expr.npy, expr_max.npy, expr_min.npy. are not generated

You comment the function named extract_blendshape, so expr.npy, expr_max.npy, expr_min.npy. are not generated. And It seems that you don't provide data_utils/bs_solver/inference.py. If possible, could you publish this script?

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.