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

- Run forward passes through the SMPL model (betas->mesh)
- Control the SMPL model with betas or with measurements(height, weight, waist, etc.)
- Interfaces with gloss for rendering meshes both in native and web
The main dependency is gloss which will be downloaded and compiled automatically when building this package.
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.
$ cd smpl-rs
$ cargo build
$ cargo run --bin smpl_minimal
First follow the instructions in gloss to build the python package. Afterwards, you can build the smpl_python bindings with:
$ cd smpl-rs/bindings/smpl_py
$ ./scripts/build_local.sh
$ ./examples/minimal.py
First install necessary dependencies
$ sudo apt install nodejs npm
$ cd smpl-rs/examples/web/visualizer
$ wasm-pack build --target web
$ npm i
To run the web example we can create a dummy web server by opening another terminal and running:
$ cd smpl-rs/examples/web/visualizer
$ npm run start
# $ python -m http.server
Finally navigate to http://localhost:3000/
in your browser of choice.
Various examples can be found in the ./examples folder.
You can run each one of them using
$ cargo run --bin <example_name>
Please read the file examples/web/visualizer/README.md
- 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 Measurements regressor 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.