Skip to main content

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

Installation

You can install smpl-pytorch from PyPI:

pip install smpl-pytorch

Additionally, you have to download the 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 smpl/native/ folder.

Alternatively, you can set up the package manually (see next).

Setting up

  • Dependencies:
    • Install the dependencies listed in environment.yml
      • In an existing conda environment, conda env update -f environment.yml
      • In a new environment, conda env create -f environment.yml, will create a conda environment named smplpytorch
  • 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 smpl/native/ folder.

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.

Metadata

Release files for smpl-pytorch 0.0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for smpl-pytorch 0.0.7
File Size Uploaded Provenance Actions
smpl-pytorch-0.0.7.tar.gz 9.1 kB Without provenance Details for smpl-pytorch-0.0.7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for smpl-pytorch 0.0.7
File Interpreter ABI Platform Actions
smpl_pytorch-0.0.7-py3-none-any.whl Python 3 none any Details for smpl_pytorch-0.0.7-py3-none-any.whl

Total release size: 32.0 kB

Release files / smpl-pytorch-0.0.7.tar.gz

Download URL smpl-pytorch-0.0.7.tar.gz
Size 9.1 kB
Tags Source
SHA-256 checksum
How to use checksums
1ad0581c030b11d6de38c407be1c4c702b1c9aef8de774f8b15d9505a832100d
BLAKE2b-256 checksum
How to use checksums
6cb6ec1070cf01a7d1b84f6e3e7e5a9cc6abf2c4c76e26a42a7fb30dd46c7c7d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.8

Release files / smpl_pytorch-0.0.7-py3-none-any.whl

Download URL smpl_pytorch-0.0.7-py3-none-any.whl
Size 22.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
805c4186505c0b1d5ad1a81510bde4c4260c80ed37dc7a58ad896e231d7eed60
BLAKE2b-256 checksum
How to use checksums
b85baef8b891353f1161fbba8819474b751742b97de648e9dec971926942b408
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.8

Security for smpl-pytorch 0.0.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.7 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page