This code demonstrates the functionality as shown in:
B. Berends, F. Bielevelt, R. Schreurs, S. Vinayahalingam, T. Maal, and G. de Jong, “Fully automated landmarking and facial segmentation on 3D photographs,” arxiv, 2023. arXiv:2309.10472
Please cite this paper when you use this work (see License).
This work is published under the Apache License Version 2.0. There are additional conditions for using this model beyond non-commercial reserach or educational use. This model has partially been trained using the HeadSpace Dataset. If you would use this work for any other purpose other than non-commercial or educational use, you must request permission at the HeadSpace team (see website).
For the installation we have the following template instructions for a python 3.10 instruction.
- Install the python environment and requisites
conda create -n landmarking python=3.10
conda activate landmarking
- (Optional) Some users reported a ClobberError regarding libnpp-dev when installing torch. You can fix this by:
conda install -c nvidia libnpp-dev
- The following packages need to be installed as following
conda install pytorch==2.0.1 torchvision==0.15.2 torchaudio==2.0.2 pytorch-cuda=11.7 -c pytorch -c nvidia
conda install -c anaconda pandas
conda install -c conda-forge scipy
conda install -c anaconda scikit-learn
conda install -c conda-forge tqdm
pip3 install open3d
pip3 install pymeshlab
pip3 install robust-laplacian
pip3 install potpourri3d
- Clone the repository to a local folder (e.g.
landmarking
) - Clone the following repository
https://github.com/Goblaski/diffusion-net-cuda
link and put it in the local folder underdiffusion-net
- Navigate to
diffusion-net
and typepython setup.py install
- Clone the following repository
https://gitlab.kuleuven.be/mirc/meshmonk
link and put it in the local folder undermeshmonk
- Follow the installation instructions of meshmonk You should now be set to run the demo.
After installation you shoulw have the following folder structure:
/Landmarking/common_functions/
/Landmarking/diffusion-net/
/Landmarking/initial_landmarking/
/Landmarking/meshmonk/
/Landmarking/meshmonk_script/
/Landmarking/models/
/Landmarking/refined_landmarking/
- Navigate to the root folder (e.g
landmarking
) - run
python prepare_demo.py
- run
python Initial_landmarking.py
Optionally you can change--input folder
and add--export_realigned_mesh
- In Matlab, open
meshmonk_script/MeshMonkFolder.m
and run. - run
python Refined_landmarking.py
Optionally you can change--input folder
, add--export_realigned_mesh
, and/or--save_segmented_mesh
.