Giter Club home page Giter Club logo

rafare's Introduction

RAFaRe

This is the official repository of ''Learning Robust and Accurate Non-parametric 3D Face Reconstruction from Pseudo 2D&3D Pairs'', AAAI 2023 (Oral). [Project Page] [arXiv]

Environment

The project is tested on Ubuntu, Anaconda with Python 3.9.

conda create -n rafare python=3.9
conda activate rafare
conda install numpy==1.23.5 -y
conda install scikit-image==0.19.3 -y
conda install pytorch==1.12.0 torchvision==0.13.0 torchaudio==0.12.0 -c pytorch -y
conda install tqdm==4.64.1 -y
conda install -c conda-forge opencv==4.7.0 -y
conda install -c conda-forge trimesh==3.18.3 -y
conda install -c conda-forge einops==0.6.0 -y
conda install -c conda-forge pyrender==0.1.45 -y
conda install -c conda-forge addict==2.4.0 -y
conda install -c conda-forge yapf==0.32.0 -y

Pretrained Model

Download from NJU drive:

./checkpoints/download_model_njudrive.sh

Or download from Google drive:

./checkpoints/download_model_googledrive.sh

Run Testing

A pre-processing is required to crop the image to be square. Our method is not sensitive to the position of the face, and the size of the face should be 50%-90% of the image size.

Test a single image:

python3 ./tools/test_image_single.py --input_fn ./data/test_imgs/1.png --num_samples 180000 # for 24G GPU memory
python3 ./tools/test_image_single.py --input_fn ./data/test_imgs/1.png --num_samples 80000 # for 12G GPU memory

Test multiple images in a folder:

python3 ./tools/test_image_batch.py --input_dir ./data/test_imgs/ --num_samples 80000 # for 24 GPU memory
python3 ./tools/test_image_batch.py --input_dir ./data/test_imgs/ --num_samples 50000 # for 12 GPU memory

Test a video:

python3 ./tools/test_video.py --input_fn ./data/test_videos/baijia.mp4 --num_samples 80000 # for 24 GPU memory
python3 ./tools/test_video.py --input_fn ./data/test_videos/baijia.mp4 --num_samples 50000 # for 12 GPU memory

Running time:

Method Time(per image/frame)
test_imgae_single 19.25s
test_image_batch 15.09s
test_video 14.97s

Reference

@inproceedings{guo2023rafare,
  title={RAFaRe: Learning Robust and Accurate Non-parametric 3D Face Reconstruction from Pseudo 2D&3D Pairs},
  author={Guo, Longwei and Zhu, Hao and Lu, Yuanxun and Wu, Menghua and Cao, Xun},
  booktitle={Proceedings of the AAAI Conference on Artificial Intelligence},
  year={2023}
}

Acknowledge

The project depends heavily on Open-PIFuHD, PIFuHD, FaceScape, Pix2PixHD, and Face-Parsing. Thanks for sharing these cool projects.

rafare's People

Contributors

zhuhao-nju avatar longwg avatar

Stargazers

Wanquan Feng avatar  avatar Cengizhan Yurdakul avatar Maxim Ignatev avatar  avatar  avatar  avatar 啊旺 avatar Sean avatar Thugger069 avatar lancer avatar Emran avatar  avatar Fatemeh Ghorbani avatar  avatar  avatar Chuan Peng avatar Antlitz.ai avatar Mr.wen avatar liheyuan avatar Xiaolin Zhang avatar Yukata avatar YiChenCityU avatar Frank avatar  avatar Blake Senftner avatar  avatar Tyler Luan avatar Carlos Barreto avatar  avatar HYUN PARK avatar tensorboy avatar  avatar  avatar Andrey Smorodov avatar 刘国友 avatar  avatar 爱可可-爱生活 avatar 个人公众号 Hypochondira avatar xuheny avatar Snow avatar  avatar  avatar  avatar Lu Ming avatar Yuda Qiu avatar  avatar  avatar  avatar YYN avatar Shenhao Zhu avatar

Watchers

刘国友 avatar YiChenCityU avatar Snow avatar  avatar HYUN PARK avatar

rafare's Issues

how to train

Hi~
Excellient work!! I find train_epochs in train.py, but I do not know how to use it, could you please show how to train the model from scratch?

About the depth value z

Hi, the paper mentions that the input value contains a depth value z. How do I get the depth value z when inferring?

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.