Git Product home page Git Product logo

peterzs / ubisoft-laforge-face-editing-face-editing-using-part-based-optimization-of-the-latent-space Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ubisoft/ubisoft-laforge-face-editing-face-editing-using-part-based-optimization-of-the-latent-space

0.0 0.0 0.0 1.62 MB

Face Editing Using Part-Based Optimization of the Latent Space

License: Other

Python 81.77% GLSL 8.72% Jupyter Notebook 9.51%

ubisoft-laforge-face-editing-face-editing-using-part-based-optimization-of-the-latent-space's Introduction

Face Editing Using Part-Based Optimization of the Latent Space

Paper

Header

Citation

This is the official PyTorch implementation of Face Editing Using Part-Based Optimization of the Latent Space. Please cite this paper if you use this code in your own work. Please also let us know.

@article{https://doi.org/10.1111/cgf.14760,
author = {Aliari, Mohammad Amin and Beauchamp, Andre and Popa, Tiberiu and Paquette, Eric},
title = {Face Editing Using Part-Based Optimization of the Latent Space},
journal = {Computer Graphics Forum},
volume = {42},
number = {2},
pages = {269-279},
keywords = {CCS Concepts, • Computing methodologies → Mesh models, Neural networks},
doi = {https://doi.org/10.1111/cgf.14760},
url = {https://onlinelibrary.wiley.com/doi/abs/10.1111/cgf.14760},
eprint = {https://onlinelibrary.wiley.com/doi/pdf/10.1111/cgf.14760},
year = {2023}
}

How to train and use the model:

  1. Install requirements.txt.

    • For installing psbody_mesh on Windows, follow this link. We use version 0.3.
  2. Place the meshes in a directory with names following this format: face (1).obj to face (i).obj.

  3. Open src/face_exctractor.py:

    • Set the heads_path to the dir mentioned in (2) in src/face_exctractor.py.
    • Run src/face_exctractor.py.
  4. Open src/part_exctractor.py:

    • Set the heads_path to the dir mentioned in (2) in src/part_exctractor.py.
    • Run src/part_exctractor.py.
  5. Open and follow the steps in src/train.py or src/train.ipynbpy to train the model.

  6. Open src/face_editor.py:

    • Set model_path to the newly trained model.
  7. The face editor can be launched now:

    • python src/face_editor.py

Demo

Dataset

The model can be trained with the FaceWarehouse dataset. It can be acquired by following the steps described here.

Project structure:

  • Model name: NEURAL_FACE

    • Path: src/coma/models/neural_face.py
  • src/face_editor.py:

    • It is an environment to edit and test the faces.
    • It supports texturing by passing viewer.add_mesh the texture image path.
      • toggle_texture() can be called to show the textures.
  • Customizable files: The following files in the /data folder are hand generated and customizable:

    1. landmarks.json: Face landmarks. These are the editing points.

    2. measures.json: These are the defined measurements.

      • We have different measures like nose width, lips height, etc.
      • New ones can easily be defined. They can also bed used with any newly defined landmarks.
      • We also have a number of equations, and new ones can be defined in util_control.py.
    3. face.csv and parts_info files:

      • These are our defined face areas and segmentations.
      • Most DCC tool can be used to select other sets of vertices for each segment.
      • Beware that some DCC tools start the vertex index from 1 and others from 0. This might introduce some bugs in runtime. Controller.do_minus_one can be set to fix the issue.

References

© [2023] Ubisoft Entertainment. All Rights Reserved

ubisoft-laforge-face-editing-face-editing-using-part-based-optimization-of-the-latent-space's People

Contributors

ubisoft-laforge 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.