Smpl-rs is the suite of SMPL functionality implemented in Rust over gloss. It has features for creating smpl-bodies, modifying and rendering them

- Run forward passes through SMPL models (betas -> mesh)
- Modify betas and expression parameters of the SMPL model in real time
- Interfaces with gloss for rendering meshes both in native and web
- smpl-rs Rust API Documentation: Automatically generated docs for smpl-rs's Rust API
- smpl-rs Rust Examples: smpl-rs's runnable examples in Rust, covering basic usage.
- smpl-rs Python Examples: smpl-rs's runnable examples for the Python bindings. Covers a wide range of features of the Python bindings.
The easiest way to get started with smpl-rs is to install the Python bindings.
$ pip install smpl-rs
Some examples of how to use the python bindings can be found in the python examples linked above.
To use smpl-rs you need to download the SMPL-X data.
- Download the models from here (Download SMPL-X with removed headbun NPZ).
- After this change the paths in the
misc_scripts/standardize_smpl.py
file to the path where you downloaded the models and where you want to save the standardized models. You will need some additional files provided in thedata/smplx
folder. - Then run as
python misc_scripts/standardize_smpl.py
to standardize the models. Lazy loading will need to be set to the path where you saved the standardized models.
The main dependency is gloss which will be downloaded and compiled automatically when building this package. You will need rust, and the rest is handled by cargo. To install Rust, simply run the following in your terminal:
$ curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh
Some additional dependencies for Linux:
$ sudo apt-get install libvulkan-dev vulkan-tools xorg-dev libxkbcommon-x11-dev
For MacOs
, it should run out of the box.
$ cd smpl-rs
$ cargo run --bin smpl_minimal
$ cd smpl-rs/bindings/smpl_py
$ pip install gloss-rs smpl-rs
$ ./examples/minimal.py
- The SMPL suite renders using gloss and therefore uses an Entity-Component-System (ECS) framework. For more info on ECS check here. However to be noted that we use [Hecs] for our ECS system but most of them are very similar.
- Components like Animation and Betas are added to entities and that dictates which systems it uses. If you don't want animation on the avatar, just comment out the component for it when creating the entity.
- For adding new functionality to gloss we use callbacks. This is needed because on WASM the rendering loop cannot be explictly controlled.