Skip to main content

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.

A teaser video showing an example result of the SMPL-X to SUPR conversion

Installation

  1. Clone the repository and its submodules:

    git clone --recurse-submodules https://github.com/NeelayS/supr_convertor.git
    
  2. Install the PyTorch version of your choice, which is compatible with your GPU, from the official website.

  3. Install the dependencies for this repository:

    cd supr_convertor && python setup.py install
    cd SUPR && python setup.py install && cd ..
    

Usage

  1. Download the SUPR model(s) from the official project website.

  2. 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 under data/.
    The output_dir should be a directory where the generated meshes will be saved. The output_format can be either ply or obj.

    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.

  3. 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 the batch_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.

  4. 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


Download files

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

Source Distribution

supr_convertor-0.0.1.tar.gz (14.5 kB view hashes)

Uploaded Source

Built Distribution

supr_convertor-0.0.1-py3-none-any.whl (13.6 kB view hashes)

Uploaded Python 3

Supported by

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