Home

Awesome

A C++ Implementation of SMPL - A Skinned Multi-Person Linear Model.

SMPL_Modle

Overview

This project implements a 3D human skinning model - SMPL: A Skinned Multi-Person Linear Model with C++. The official SMPL model is available at http://smpl.is.tue.mpg.de.

The author-provided implementation based on Chumpy and OpenDR contains spaghetti code, and it cannot run on GPUs yet. I convert and update another Tensorflow version of SMPL contributed by CalciferZh to C++ style. You can find the Tensorflow implementation here. However, Tensorflow C++ APIs are not user-friendly, so I choose the Pytorch C++ APIs - libTorch - instead.

For more details, see the paper published by Max Planck Institute for Intelligent Systems on SIGGRAPH ASIA 2015.

Prerequisites

I have tested the codes on my machine, but I'm not sure the performance on other environments.

  1. xtensor: A C++ library meant for numerical analysis with multi-dimensional array expressions.

    A C++ interpretation of Numpy, you can even find functions with similar names in it. A [cheat sheet (https://xtensor.readthedocs.io/en/latest/) from Numpy to Xtensor is helpful.

    Currently, I only use Xtensor as an IO interface for module testing with random inputs and restoring hyperparameters in JSON format. Share the buffer of an Xtensor array with a corresponding PyTorch tensor is straightforward.

  2. nlohmann_json: JSON for Modern C++.

    Xtensor loads data from and dumps data into JSONs through nlohmann's toolkit.

  3. libTorch: Pytorch C++ API.

    PyTorch C++ API simplifies tensor computing and introduces GPU acceleration to this work, using CUDA and cuDNN.

    Note: I installed the nightly version of libTorch with CUDA 10.0 support.

  4. CUDA: NVIDIA parallel computing platform.

    CUDA 10.0 works well on my machine. I think the other versions fit the libTorch download list should work as well.

  5. CMake: A tool to build, test and pack up C++ program.

    The CMake installed by apt-get is CMake 3.5.1 which causes a failure when libTorch tries to find CUDA. A description of the issue: https://discuss.pytorch.org/t/install-libtorch-error-pytorch-c-api/26756/2

    You should update it to a newer version, such as 3.13.4 (>=3.12.2 should work). Delete the old CMake completely, download the latest official source codes, and build it from scratch.

Build on Linux

Build on Window

Follow these steps: https://github.com/YeeCY/SMPLpp/issues/5#issue-492889787.

Instructions

The project is simply a raw framework for SMPL++. I have written many comments in the source codes, but there may be some typoes. Sorry about that.

TODO

Note: The importance of each demand decreases in this list.

Misc

If you find any problem, error, or even typo, feel free to contact me.

SMPL++ is for research purposes only. Any commercial usage should be allowed by original authors.

Links

[1] Official Website of SMPL: http://smpl.is.tue.mpg.de.

[2] Official Website of SMPLify: http://smplify.is.tue.mpg.de.