A simple tool to convert SMPL-X model parameters to SUPR model parameters.
-
Clone the repository and its submodules:
git clone --recurse-submodules https://github.com/NeelayS/supr_convertor.git
-
Install the PyTorch version of your choice, which is compatible with your GPU, from the official website.
-
Install the dependencies for this repository:
cd supr_convertor && python setup.py install cd SUPR && python setup.py install && cd ..
-
Download the SUPR model(s) from the official project website.
-
Use the
generate_smplx_meshes.py
to script to generate meshes from SMPL-X parameters and save them as either.ply
or.obj
files.First, install the SMPL-X package, if you don't already have it installed.
Then, run the script as follows:
python generate_smplx_meshes.py --params_path <path_to_smplx_params> --model_path <path_to_smplx_model> --output_dir <path_to_output_dir> --output_format <ply/obj>
The
smplx_params_path
should be a.npz
file containing the SMPL-X parameters. The.npz
file should contain the different model parameters and metadata such as gender. An example file from the AMASS dataset has been provided in this repository underdata/
.
Theoutput_dir
should be a directory where the generated meshes will be saved. Theoutput_format
can be eitherply
orobj
.If you don't have the SMPL-X model file(s), you can download them from the official website.
Note: You can skip this step if you already have SMPL-X meshes in
.ply
or.obj
format. -
Modify the base config file
configs/base_config.yaml
to suit your needs. In particular, you must specify the following parameters:data: mesh_dir: <path_to_smplx_meshes> model: gender: <gender_of_supr_body_model> path: <path_to_supr_model> device: <device_to_use> out_dir: <path_to_output_dir>
The rest of the parameters can be left as is, or modified as per your requirements.
To convert the parameters in the least amount of time, set thebatch_size
to the maximum possible value, constrained by the available device memory.
The number of iterations of the optimization process for the conversion and the stopping conditions can be modified according to the use case.Note: Be careful to use the same gendered SUPR model as the SMPL-X model used to generate the meshes.
-
Run the
convert.py
script to convert the parameters.python convert.py --cfg <path_to_your_config_file>
The converted SUPR parameters will be saved in the
out_dir
specified in the config file. Optionally, SUPR meshes obtained from the converted parameters can be saved as well.
The code in this repository takes (heavy) inspiration from the SMPL-X repository, developed by Vasileios Choutas. It also relies on the SUPR repository, developed by Ahmed Osman. The author would also like to thank team members Ahmed Osman, Anastasios Yiannakidis, Giorgio Becherini, Jinlong Yang, Peter Kulits, and Vasileios Choutas for their insights and helpful discussions. The animation in this README showing an example conversion result was created by Anastasios Yiannakidis.
The code in this repository was developed by Neelay Shah at the Max Planck Institute for Intelligent Systems.
If you have any questions about the code or its usage, please create an issue here on GitHub or contact [email protected].
For commercial licensing (and all related questions for business applications), please contact [email protected].