Giter Site home page Giter Site logo

marilynkeller / skel Goto Github PK

View Code? Open in Web Editor NEW
145.0 11.0 16.0 12.25 MB

Release for the Siggraph Asia 2023 SKEL paper "From Skin to Skeleton: Towards Biomechanically Accurate 3D Digital Humans".

Home Page: https://skel.is.tue.mpg.de/

License: Other

Python 100.00%
3d-models body mesh model parametric-model skeleton statistical-shape-model

skel's Introduction

SKEL

Image Description

This repository is part of the code release for the Siggraph Asia 2023 paper "From Skin to Skeleton: Towards Biomechanically Accurate 3D Digital Humans".

[paper] [project page]

This repo contains the pytorch SKEL loader and the code to align it to SMPL sequences.

SKEL is a parametric body shape and skeleton model. Its pose parameter lets you change the body shape and its pose parameter lets you pose the skeleton in an anatomically plausible way. Given shape and pose parameters, SKEL returns joint locations, a body mesh, and a skeleton mesh. SKEL is differentiable and can be fit to various data like motion capture or SMPL sequences.

For more details, please check our Siggraph 2023 paper: From Skin to Skeleton: Towards Biomechanically Accurate 3D Digital Humans.

Table of Contents

Quickstart

For a minimal use, you will have to follow the install instructions in Set up the environment and Downloading SKEL.

To test the SKEL model, you can then run:

python quickstart.py 

This runs the forward pass of SKEL and saves the output as separated body and skeleton meshes.

You can then try to change the SKEL parameters knowing the following. SKEL is controled by two parameters:

  • betas controls the shape of the body (tall, small, skinny, etc...). It is a vector of size 10. The values should remain between -2 and 2. The first value of the vector roughly controls the height, the second value the weight.

  • pose controls the body pose. It is a vector of size 46, most values are angles expressed in radian, and can vary between -3.14 and 3.14. You can see which of the 46 parameters controls which body articulation here .

SKEL(beta, pose) yields:

  • A skeleton 3D mesh
  • A body mesh
  • Anatomical joint locations

The rest of this readme will let you setup our SKEL vizualizer and run some demo code. We hope you enjoy our work!

Installation

Set up the environment

Clone this repository

git clone https://github.com/MarilynKeller/SKEL
cd SKEL

Create a virtual environment and install the SKEL package

pip install -U pip   
python3.8 -m venv skel_venv
source skel_venv/bin/activate
pip install git+https://github.com/mattloper/chumpy 
pip install -e .

Downloading SKEL

Create an account on https://skel.is.tue.mpg.de/ (Necessary for the download to work).

Then download the SKEL model from the download page with the "Download Models" button. Extract the downloaded folder and edit the file SKEL/skel/config.py to specify the folder containing the downloaded SKEL model folder: skel_folder = '/path/to/skel_models_v1.0

Below, we explain how to set up the visualizer for SKEL (only supported on Linux and Mac), and run some example code.

Aitviewer

If you want to run the Demos, you will also need our aitviewer fork for visualization:

cd ..
git clone https://github.com/MarilynKeller/aitviewer-skel.git
cd aitviewer-skel 
pip install -e .

Edit then the file aitviewer/aitviewer/aitvconfig.yaml to point to the SKEL folder:

skel_models: "/path/to/skel_models_v1.0"

SMPL and MPI Mesh package

! Note that the MPI mesh package is only supported on Linux systems. If you are not on Linux, you will have to comment out the code depending on the package psbody.mesh and code your own visualization.

If you want to run an alignment to SMPL, you need to download the SMPL model. First, create an account on https://smpl.is.tue.mpg.de/. Then download this file: SMPL_python_v.1.1.0.zip from the download page. And run:

cd ../SKEL
python scripts/setup_smpl.py /path/to/SMPL_python_v.1.1.0.zip  

For visualizing the fitting process you need the MPI mesh package, you can install it with the following line:

pip install git+https://github.com/MPI-IS/mesh.git  

Note that the mesh package is only supported on Linux, but it is only necessary for the visualization of the fitting processes.

Demos

Pose parameters

Visualize the effects of the pose parameters of SKEL:

python examples/skel_poses.py --gender male

Image Description

Shape space

Vizualize the shape space:

python examples/skel_betas.py --gender female 

Rigging

Visualize the skinning weights of the skin and bones to the SKEL kinematic tree:

python examples/skel_rigging.py --gender female  

Vizu of SKEL skinning weights

Visualize the kinematic tree and joint locations of SKEL:

python examples/skel_kintree.py --gender female

Vizu of SKEL kin tree

You can see a visual of the joint ids here and their names and the list of degrees of freedom here

SKEL sequence

Visualize a SKEL sequence. You can find a sample SKEL motion in skel_models_v1.0/sample_motion/ and the corresponding SMPL motion.

python examples/skel_sequence.py /path/to/skel_models_v1.x/sample_motion/01_01_poses_skel.pkl -z 

To visualize the SMPL sequence alongside :

python examples/skel_sequence.py /path/to/skel_models_v1.0/sample_motion/01_01_poses_skel.pkl -z --smpl_seq /path/to/skel_models_v1.0/sample_motion/01_01_poses.npz

Aligning SKEL to SMPL sequences

SKEL can be aligned to SMPL sequences. You can download SMPL sequences from the AMASS Download page, and selecting the SMPL+H G sequences.

Here is the command to run the alignment:

python examples/align_to_SMPL.py /path/to/AMASS/CMU/01/01_01_poses.npz -F 

Aligning SKEL's skin to another skeleton model joint locations

If you have another skeleton model, you can define the mapping between your skeleton model joints and SKEL's joint and optimize SKEL.shape and pose in consequence to obtain a skin mesh that fits your skeleton model.

python examples/fit2joints.py 

Acknoledgments

This research was done partly at The Movement Lab in Stanford and Perceiving Systems at the Max Planck Institute for Intelligent Systems.

We thank Neelay Shah for generating all the necessary SMPL fits, A. A. Osman for his expertise on parametric body models, Shashank Tripathi for his help with MOYO, Giorgio Becherini for his expertise on AMASS and mocap fit evaluation, Peter Kultis, Yao Feng and Yuliang Xu for feedbacks on the paper. We also thank the TML lab and the NMBL lab at Stanford for the fruitful discussions, especially Jennifer Maier for her expertise on the shoulder.

Citation

If you use this software, please cite the following work and software:

@inproceedings{keller2023skel,
  title = {From Skin to Skeleton: Towards Biomechanically Accurate 3D Digital Humans},
  author = {Keller, Marilyn and Werling, Keenon and Shin, Soyong and Delp, Scott and 
            Pujades, Sergi and Liu, C. Karen and Black, Michael J.},
  booktitle = {ACM ToG, Proc.~SIGGRAPH Asia},
  volume = {42},
  number = {6},
  month = dec,
  year = {2023},
}

License

This code and model are available for non-commercial scientific research purposes as defined in the LICENSE.txt file.

Contact

For any questions about SKEL loading, please contact [email protected].

For commercial licensing, please contact [email protected]

skel's People

Contributors

marilynkeller avatar

Stargazers

Jere Lavikainen avatar Artur K. avatar  avatar Pierre Puchaud avatar Wannes De Vleeschouwer avatar  avatar  avatar Gabriel Dennis avatar Tsuyuki avatar  avatar  avatar Anish Dulal avatar  avatar jonn avatar  avatar  avatar David Oluwatimilehin Bamikole avatar Xiong Lin avatar Gleb Sterkin avatar Maksym Tymkovych avatar  avatar  avatar  avatar i-LUDUS avatar  avatar gm avatar doubleZ avatar  avatar tensorboy avatar Shenhan Qian avatar Vanessa Sklyarova avatar Mingdian Liu avatar Nguyen Ngoc Yen Nga avatar  avatar  avatar Zehong avatar  avatar Jonas Klesen avatar Hyeontae Son avatar Christian Diller avatar  avatar MU SHENG avatar  avatar Yan Xia avatar Junjie Wang avatar Marcus L Endicott avatar Wojciech Zielonka avatar Qi Li avatar  avatar  avatar Jeroen Van Goey avatar JerryZhang_ avatar Vidhi Waghela avatar Vittorio Caggiano avatar Berna Kabadayı avatar Cao Yukang avatar Exsan avatar Yalım Doğan avatar Akash avatar István Sárándi avatar Sergey Prokudin avatar  avatar gradetwo avatar Zuo Chenhui avatar Vassilis Choutas avatar Shareef Ifthekhar avatar Jerome Drese avatar fri tol avatar David Marx avatar 918 avatar Fabio Dias Rollo avatar learner avatar  avatar Ashish Sinha avatar NewCoderQ avatar leanAI avatar chambin avatar  avatar Erich Ocean avatar  avatar Yanhao Zhang avatar Satpreet avatar Muhammed Kocabas avatar gotomypc avatar Zhongpai Gao avatar  avatar  avatar Huayi Zhou avatar SimonLee avatar  avatar Ilya Zakharkin avatar  avatar  avatar  avatar  avatar Annabel Groenenberg avatar Zhu Shuai avatar Wuyang LI avatar peabody124 avatar ElonKou avatar

Watchers

Snow avatar Kostas Georgiou avatar Vittorio Caggiano avatar  avatar Mohammadreza Rezaie avatar  avatar Exsan avatar  avatar  avatar  avatar  avatar

skel's Issues

Error in fit2joints

When i try to run fit2joints I get the following error:
File "..\skel\examples\fit2joints.py", line 15, in
from psbody.mesh import Mesh, MeshViewer
ModuleNotFoundError: No module named 'psbody

Export .osim and .mot files after align to SMPL

Hi Marilyn,

Thanks a lot for your contributions in connecting SMPL with Biometric skeletons. I really like your code pool. It is very clear and compact.

May I ask if it is possible to export *.osim and *.mot files as well from the SMPL alignment script below, so that can connect with many applications on opensim?

python examples/align_to_SMPL.py /path/to/AMASS/CMU/01/01_01_poses.npz -F  

Thanks a lot.

Best,
Yinyu

46 params vs SMPL 72 params

Hi, fantastic work on this project. I am still in the process of reading the article but looking at the code, do the 46 parameters represent linked positions? I.e., index 0-3 is orientation for joint a, and index 3-5 is orientation for joint b? Whereas smpl is just 23x3.

*edit meant index [0, 1, 2] , [2, 3, 4]... etc.

It seems that there is no "skel_models_v1.1.zip"?

Thanks for your great work,
I'm trying download the "skel_model_v1.1.zip", but the download page shows that download.is.tue.mpg.de didn’t send any data., how can I download the files? Thank you!

Issue with numpy.AxisError in align_to_SMPL.py

Hello, thanks for great work.
I am window user. nimblephysics doesn't work with me right now, so I am testing the code without Aitviewer.
I encountered error when running the example, python examples/align_to_SMPL.py /path/to/AMASS/CMU/01/01_01_poses.npz -F

Traceback (most recent call last):
    skel_seq = skel_fitter.fit(smpl_seq['trans'],
  File "E:\skel\SKEL-master\skel\alignment\aligner.py", line 175, in fit
    betas_in = betas_in.repeat(poses_in.shape[0], 1)
numpy.AxisError: axis 1 is out of bounds for array of dimension 1

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.