GitXplorerGitXplorer
i

machine-learning-facial-deformer

public
29 stars
4 forks
0 issues

Commits

List of commits on branch main.
Verified
2956804d893f073d77cf7224d99b73a708d7d816

Update README.md

iinisis committed 3 years ago
Verified
7f874c98826a84b562178464b48bc93d9394c7ca

Update README.md

iinisis committed 3 years ago
Verified
dcea55d0ffb60403ab788881fcd2322010ef46a4

Update and rename generate_frame_and_save.py to generate_frame.py

iinisis committed 3 years ago
Unverified
ad35777bf01e7ac2404e80b522e15a61205cc233

add youtube video

iinisis committed 4 years ago
Unverified
91581d6c76ac41f2c0b470bbfdfa11a743ab7869

update demo

iinisis committed 4 years ago
Unverified
4c7cb1d880de81b1daf55ae802c22a41fadd962c

add weight map demonstration

iinisis committed 4 years ago

README

The README file for this repository.

machine-learning-facial-deformer

This repo is used to map Controller value to Mesh Vertex by using Artificial Neural Network.

Awesome Ray

Prerequisites

  • Maya [2018.6] [Cut ID:201903222215-65bada0e52]
  • Python 3.6
  • Numpy in Maya (you can download the python env and copy the numpy under Lib/sit-packages/ to your folder)

How to use it

Character rig file Ray is used to demonstrate my code, you can use the modified one from google cloud, the modification lies in that I split the head and body. Thanks for CGTarian for developing and releasing the character rig.

  1. Training data generation
  • it's recommended that you arrange your data folder like this
data
│
└───csv
│
└───ctrl
│
└───mesh
│   
└───pca
  • you should prepare a controller config file as below if you want to train your own character, I have a default one in config/ctrlName.txt for character Ray.
Each line is as follows:
ControlName ControlType Index MinVAlue MaxValue (DefaultValue if there is)
Control type is either r-rotation, t-translation, or s-scale
Index is either x, y, or z
ray_ac_lf_upperlid t y -1 1 0.781
      .
      .
      .
ray_ac_cn_wrinkles c nose_bridge_intensity 0 2 0.5
  • then you can run below script in Maya Script Editor
import sys
sys.path.append("/full/path/to/top/level/of/this/repository")
import os
os.chdir("/full/path/to/top/level/of/this/repository")
import script.generate_frame as gf
gf.main(controller_file_path="/full/path/to/your/controller/file", frame_num=num_of_frames_to_generate)
  1. Training csv generation
python script/generate_csv.py "/full/path/to/your/data/folder" "/full/path/to/your/csv/folder"
  1. PCA
python bin/pca.py "/full/path/to/your/training/csv/file" num_of_pca_components
  1. Training
python bin/train.py config/example.yaml "/full/path/to/your/training/save/folder" --num_workers=4 --device_ids=0
  1. Testing
python bin/test.py "/full/path/to/your/training/save/ckpt" "/full/path/to/your/training/config/file" "/full/path/to/your/test/csv/file"
  1. Weight map

References

@article{Bailey:2020:FDF,
  note = {Presented at SIGGRAPH 2020, Washington D.C.},
  doi = {10.1145/3386569.3392397},
  title = {Fast and Deep Facial Deformations},
  journal = {ACM Transactions on Graphics},
  author = {Stephen W. Bailey and Dalton Omens and Paul Dilorenzo and James F. O'Brien},
  number = 4,
  month = aug,
  volume = 39,
  year = 2020,
  pages = {94:1--15},
  url = {http://graphics.berkeley.edu/papers/Bailey-FDF-2020-07/},
}
  • FaceBaker
@inproceedings{inproceedings,
author = {Radzihovsky, Sarah and Goes, Fernando and Meyer, Mark},
year = {2020},
month = {08},
pages = {1-2},
title = {FaceBaker: Baking Character Facial Rigs with Machine Learning},
doi = {10.1145/3388767.3407340}
}