Skip to main content

Multi-backend parametric body models (SMPL, SMPLH, SMPLX, FLAME, SKEL, ANNY, MHR, SOMA, GarmentMeasurements, BrainCo, G1) for NumPy, PyTorch, and JAX

Project description

Body model lineup

body-models

body-models provides a shared interface for parametric human body, head, hand, anatomical, measurement, and robot models across NumPy, PyTorch, and JAX.

Documentation: https://abcamiletto.github.io/body-models/

Features

  • Shared API across human, anatomical, hand, head, measurement, and robot models
  • NumPy, PyTorch, and JAX backends
  • Separate mesh and skeleton forwards with forward_vertices() and forward_skeleton()
  • Prepared identities for repeated poses with fixed shape/expression parameters
  • Mesh simplification and vertex-subset forwards for supported mesh models
  • Multiple rotation representations for supported pose models

Install

uv add body-models

Install optional extras when needed:

uv add "body-models[torch]"
uv add "body-models[jax]"

Quick Start

import body_models

model = body_models.create_model("smpl", backend="torch")
params = model.get_rest_pose(batch_dims=(1,))

vertices = model.forward_vertices(**params)
skeleton = model.forward_skeleton(**params)

Discover available model names with body_models.list_models(). Model options such as gender="male" or side="left" are passed as constructor kwargs.

When shape-dependent identity parameters stay fixed across many poses, prepare them once and pass the returned dictionary back through identity. This avoids recomputing rest joints, local offsets, and rest vertices on every forward pass.

shape = params.pop("shape")
identity = model.prepare_identity(shape)

vertices = model.forward_vertices(**params, identity=identity)
skeleton = model.forward_skeleton(**params, identity=identity)

For models with expression-dependent rest state, such as SMPL-X and FLAME, pass both identity controls to prepare_identity(shape, expression). Skeleton-only work can use skip_vertices=True to avoid preparing rest vertices.

Supported Models

  • Full bodies: SMPL, SMPL-H, SMPL-X, ANNY, MHR, SOMA, GarmentMeasurements
  • Anatomicals: SKEL, MyoFullBody
  • Heads: FLAME
  • Hands: MANO
  • Robots: BrainCo, G1

See the model docs for setup, supported backends, inputs, and model-specific behavior.

Development

uv run ruff format .
uv run ruff check .
uv run ty check

License

See the documentation and upstream model projects for model-specific license terms.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

body_models-0.16.0.tar.gz (164.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

body_models-0.16.0-py3-none-any.whl (298.5 kB view details)

Uploaded Python 3

File details

Details for the file body_models-0.16.0.tar.gz.

File metadata

  • Download URL: body_models-0.16.0.tar.gz
  • Upload date:
  • Size: 164.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for body_models-0.16.0.tar.gz
Algorithm Hash digest
SHA256 0455988b57eaa178eb69777c307674343d2a7e4d8a342cf283e4016821a36cd3
MD5 f1b4964e224dc7bee7ff9ed3eaef4c0f
BLAKE2b-256 1144cec4caf34d7cd8dd53f9ccaaae402e9d753ae2397cadd33eea85a64c5f01

See more details on using hashes here.

File details

Details for the file body_models-0.16.0-py3-none-any.whl.

File metadata

  • Download URL: body_models-0.16.0-py3-none-any.whl
  • Upload date:
  • Size: 298.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for body_models-0.16.0-py3-none-any.whl
Algorithm Hash digest
SHA256 99172b820b75ce0e59e1b06d5044b562995289ceec2dab2a3ae06a3f913d73d7
MD5 84b5354a8f46e9f88186874c19e3d12d
BLAKE2b-256 30bf71fcf60f142a169bd1070db1a93444c08d19302df4f887ecbe67c90045a6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page