A simple tool to convert SMPL-X model parameters to SUPR model parameters.
Project description
SUPR Convertor
A simple tool to convert SMPL-X model parameters to SUPR model parameters.
Installation
-
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 ..
Usage
-
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.
Acknowledgment
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.
Contact
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 neelay.shah@tuebingen.mpg.de.
For commercial licensing (and all related questions for business applications), please contact ps-licensing@tue.mpg.de.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file supr_convertor-0.0.1.tar.gz
.
File metadata
- Download URL: supr_convertor-0.0.1.tar.gz
- Upload date:
- Size: 14.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.14.0 pkginfo/1.7.1 requests/2.26.0 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 84612a0145b6e8fb495bb00b925695c91253cca5333ac22551a4316a257cedd6 |
|
MD5 | 46baf813ddf37c297a9a129570a8e12d |
|
BLAKE2b-256 | a28b8b5b0f5ae704fe183f08d11c879d373fd1f82a41592a527d8174783d4cce |
File details
Details for the file supr_convertor-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: supr_convertor-0.0.1-py3-none-any.whl
- Upload date:
- Size: 13.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.14.0 pkginfo/1.7.1 requests/2.26.0 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4cb4ad28b3ab3ebf30779ec2bf262fc303b3025a5d829edc3e6f699343cc07bc |
|
MD5 | b3547a64bdbf359f1a26b255d34e58aa |
|
BLAKE2b-256 | 2a637b56b12065650ea887abf58c463fb9b8ac5d8e6f69af4683dd3cd3ac110a |