Git Product home page Git Product logo

bfm_to_flame's Introduction

Convert from Basel Face Model (BFM) to FLAME

This repository demonstrates

  1. how to create a FLAME texture model from the BFM vertex color space, and
  2. how to convert a BFM mesh to a FLAME mesh.

About FLAME

FLAME is a lightweight and expressive generic head model learned from over 33,000 of accurately aligned 3D scans. Public FLAME related repositories:

Setup

Install pip and virtualenv

sudo apt-get install python3-pip python3-venv

Clone the git project:

git clone https://github.com/TimoBolkart/BFM_to_FLAME.git

Set up and activate virtual environment:

mkdir <your_home_dir>/.virtualenvs
python3 -m venv <your_home_dir>/.virtualenvs/BFM_to_FLAME
source <your_home_dir>/.virtualenvs/BFM_to_FLAME/bin/activate

Make sure your pip version is up-to-date:

pip install -U pip

Install requirements

pip install numpy==1.19.4
pip install h5py==3.1.0
pip install chumpy==0.70 
pip install opencv-python==4.4.0.46

Create texture model

Download BFM 2017 (i.e. 'model2017-1_bfm_nomouth.h5') from here and place it in the model folder. Download inpainting masks from here and place it in the data folder.

Running

python col_to_tex.py

outputs a 'FLAME_albedo_from_BFM.npz' in the output folder. This file can be used with several FLAME-based repositories like TF_FLAME or FLAME photometric optimization.

Convert meshes

Install mesh processing libraries from MPI-IS/mesh within the virtual environment. Download FLAME from here and place it in the model folder.

Running

python mesh_convert.py

outputs a FLAME mesh for a specified BFM mesh. The demo supports meshes in 'BFM 2017', 'BFM 2009', or 'cropped BFM 2009' (i.e. as used by 3DDFA) topology.

Citing

When using this code, the generated texture space, or FLAME meshes in a scientific publication, please cite

@article{FLAME:SiggraphAsia2017,
  title = {Learning a model of facial shape and expression from {4D} scans},
  author = {Li, Tianye and Bolkart, Timo and Black, Michael. J. and Li, Hao and Romero, Javier},
  journal = {ACM Transactions on Graphics, (Proc. SIGGRAPH Asia)},
  volume = {36},
  number = {6},
  year = {2017},
  url = {https://doi.org/10.1145/3130800.3130813}
}

When using the converted texture space, please further follow the license agreement of the BFM model as specified here.

Acknowledgement

We thank the authors of the BFM 2017 model for making the model publicly available.

bfm_to_flame's People

Contributors

timobolkart avatar

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.