*equal contribution †corresponding author
conda create -n ems python=3.8
conda activate ems
# Install pytorch
pip install torch==1.11.0+cu113 torchvision==0.12.0+cu113 torchaudio==0.11.0 --extra-index-url https://download.pytorch.org/whl/cu113
# Install pytorch3d
pip install fvcore iopath
pip install --no-index --no-cache-dir pytorch3d -f https://dl.fbaipublicfiles.com/pytorch3d/packaging/wheels/py38_cu113_pyt1110/download.html
# Install other dependencies
pip install -r requirements.txt
Build the Cython version of NMS for 3DDFA_V2 in the preprocess/external directory:
cd preprocess/external/3DDFA_V2
bash ./build.sh
Compile the orient2d cpp code (tested on Ubuntu 20.04 with gcc-9.4.0).
Prior to building orient2d, ensure that you have installed the fftw3 library.
sudo apt-get install libfftw3-dev
Then use CMake to build orient2d:
cd preprocess/orient2d
mkdir build && cd build
cmake ..
make -j8
Install mesh processing libraries from MPI-IS/mesh.
First, we need to prepare the input data, including the 3D head, eyebrow matting, and the orientation map.
Download the assets from Google Drive and unzip them, then put the assets under the preprocess folder.
bash scripts/preprocess.sh
Download the checkpoints from Google Drive and place the extracted checkpoints in the root directory.
Then you need to run the RootFinder algorithm to identify the root points, which serve as the starting locations for eyebrow growth.
bash scripts/test_root.sh
Next, execute OriPredictor to predict the direction of eyebrow growth. In this step, each hair fiber is extended 13 samples with a unit length of 0.014.
bash scripts/test_orien.sh
Finally, run FiberEnder to determine the length of each eyebrow fiber.
bash scripts/test_len.sh
To get the blender particle system hair, you can run
blender -b -P npy2blend.py -- --data_item revision_013
📝 Note: We test our code on blender-3.6.14. However, it cannot run on versions above blender-4.0
If you obtain the blend file, you can render the eyebrow to achieve a result similar to the figure shown:
The code is released under the Attribution-NonCommercial 4.0 International License.
Copyright (c) 2024
For commercial use and commercial license, please contact: hanxiaoguang@cuhk.edu.cn.
Our code is based on these wonderful repos, many thanks to all the authors for sharing!
@article{li2023ems,
title={EMS: 3D Eyebrow Modeling from Single-view Images},
author={Li, Chenghong and Jin, Leyang and Zheng, Yujian and Yu, Yizhou and Han, Xiaoguang},
journal={ACM Transactions on Graphics (TOG)},
volume={42},
number={6},
pages={1--19},
year={2023},
publisher={ACM New York, NY, USA}
}
