This code provides a quick visualization of the FLAME model.
You need to gather the flame data (FLAME 2020) from MPI Flame webpage, login required.
Put the downloaded data under data/FLAME2020.
You will also need PyTorch3D for basic render, and streamlit for interactive purpose.
Consult PyTorch3D installation page on how to install it.
streamlit can be installed with pip install streamlit
.
To view the mesh in 3D, you can use open3D with pip install open3d
.
-
generate a single image from FLAME
python pytorch_visualize.py
. -
view FLAME mesh in 3D
python open3d_visualize.py
-
interactively FLAME parameters
CPU onlystreamlit run pytorch_interactive.py -- --img_size 256 --fov 40 --geneder generic --device cpu
CUDAstreamlit run pytorch_interactive.py -- --img_size 1024 --fov 40 --geneder generic --device cuda
In the interactive app
- shading is not updated as the geometry changes.
- CPU only is rather slow
This code is released under the MIT license. The FLAME shape model is also released under a similar license.
However, the rest of the MPI resource (texture space, SMPL-X model and repo) are released under non-commerical only license. Please respect their corresponding licenses when using this repo.