Code Monkey home page Code Monkey logo

smplpytorch's Introduction

SMPL layer for PyTorch

SMPL human body [1] layer for PyTorch (tested with v0.4 and v1.x) is a differentiable PyTorch layer that deterministically maps from pose and shape parameters to human body joints and vertices. It can be integrated into any architecture as a differentiable layer to predict body meshes. The code is adapted from the manopth repository by Yana Hasson.

smpl

Setup

1. The smplpytorch package

  • Run without installing: You will need to install the dependencies listed in environment.yml:
    • conda env update -f environment.yml in an existing environment, or
    • conda env create -f environment.yml, for a new smplpytorch environment
  • Install: To import SMPL_Layer in another project with from smplpytorch.pytorch.smpl_layer import SMPL_Layer do one of the following.
    • Option 1: This should automatically install the dependencies.
      git clone https://github.com/gulvarol/smplpytorch.git
      cd smplpytorch
      pip install .
    • Option 2: You can install smplpytorch from PyPI. Additionally, you might need to install chumpy.
      pip install smplpytorch

2. Download SMPL pickle files

  • Download the models from the SMPL website by choosing "SMPL for Python users". Note that you need to comply with the SMPL model license.
  • Extract and copy the models folder into the smplpytorch/native/ folder (or set the model_root parameter accordingly).

Demo

Forward pass the randomly created pose and shape parameters from the SMPL layer and display the human body mesh and joints:

python demo.py

Acknowledgements

The code largely builds on the manopth repository from Yana Hasson, which implements the MANO hand model [2] layer.

The code is a PyTorch port of the original SMPL model from chumpy. It builds on the work of Loper et al. [1].

The code reuses part of the code by Zhang Xiong to compute the rotation utilities.

If you find this code useful for your research, please cite the original SMPL publication:

@article{SMPL:2015,
    author = {Loper, Matthew and Mahmood, Naureen and Romero, Javier and Pons-Moll, Gerard and Black, Michael J.},
    title = {{SMPL}: A Skinned Multi-Person Linear Model},
    journal = {ACM Trans. Graphics (Proc. SIGGRAPH Asia)},
    number = {6},
    pages = {248:1--248:16},
    volume = {34},
    year = {2015}
}

References

[1] Matthew Loper, Naureen Mahmood, Javier Romero, Gerard Pons-Moll, and Michael J. Black, "SMPL: A Skinned Multi-Person Linear Model," SIGGRAPH Asia, 2015.

[2] Javier Romero, Dimitrios Tzionas, and Michael J. Black, "Embodied Hands: Modeling and Capturing Hands and Bodies Together," SIGGRAPH Asia, 2017.

smplpytorch's People

Contributors

gulvarol 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.