• Stars
    star
    161
  • Rank 233,470 (Top 5 %)
  • Language
    C++
  • License
    Apache License 2.0
  • Created over 4 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Super fast SMPL/+H/-X implementation in C++, with CUDA support and a built-in OpenGL renderer

SMPL-X C++ implementation in Eigen and CUDA. (WIP!) AMASS integration included.

Dependencies

  • Compiler supporting C++ 17 (I am using GCC 9.3.0)

Optional Dependencies

  • OpenGL 3+ (Required to build the viewer)
  • CUDA Toolkit with nvcc supporting C++ 14 (I have CUDA 11, not tested with earlier versions)
  • Very optional: https://www.github.com/sxyu/sdf to build 'smplx-prox', which shows a cross-section of continuous SDF values inside the SMPL model

Getting the SMPL/SMPL+H/SMPL-X Models

  • See data/models/README.md
  • Set SMPLX_DIR environment variable to the project root directory to allow finding default data files (else you must cd to project root or in a subdirectory for the project to work)

Building

Note: I have built successfully on Ubuntu 20.04 and Windows 10 (VS2019). The project appears to run about 1.5x slower on Windows for some reason.

  • To configure, mkdir build && cd build && cmake ..
    • To disable the OpenGL Viewer, replace the above cmake command with cmake .. -D SMPLX_BUILD_VIEWER=OFF
  • To build, use make -j<number-of threads-here> on unix-like systems, cmake --build . --config Release else
  • To install (unix only), use sudo make install (TODO: add CMake find module)

Python

To install Python bindings, use pip install . You may need to first install pybind11 from https://github.com/pybind/pybind11. Usage example:

from smplxpp import ModelS, BodyS, SequenceAMASS, Gender
# SMPL model. Use ModelX/BodyX for SMPL-X,
# ModelH/BodyH for SMPL+H, ModelXpca/BodyXPca for SMPL-X with hand PCA
model = ModelS(Gender.male)
body = BodyS(model)

seq = SequenceAMASS("/data/AMASS/KIT/10/RightTurn01_poses.npz")

# Use sequence to pose body
seq.set_shape(body)
seq.set_pose(body, 10) # Frame 10

# Do skinning (prefers GPU)
body.update()

print(body.verts) # vertices

import trimesh
tm = trimesh.Trimesh(body.vertices, model.faces) 
tm.show()

Example programs

  • smplx-example: Writes SMPL-X model toout.obj
    • Usage: ./smplx-example gender where gender (optional, case insensitive) should be NEUTRAL/MALE/FEMALE; NEUTRAL is default
  • smplx-viewer (if SMPLX_BUILD_VIEWER=ON in CMake): Shows an interactive 3D viewer, including parameter controls
    • Usage: `./smplx-viewer model gender device poseblends where
      • All arguments are position and optional
      • model may be S/S1/H/X/Z/Xp/Zp (sorry about the mess here), where S means SMPL, H means SMPL+H, X means SMPL-X (with hand joints), and Xp means SMPL-X (with hand PCA). Default is S
        • New: X/Xp now specify SMPL-X v1.1 by default. Use Z/Zp for v1.0
        • New: S now specify SMPL v1.1 by default. Use S1 for v1.0
      • gender may be NEUTRAL/MALE/FEMALE; NEUTRAL is default (case insensitive)
      • device may be gpu/cpu; gpu is default and will fallback to cpu automatically
      • poseblends may be on/off, default on; off turns off pose blendshapes, which speeds up computation dramatically
      • Example: ./smplx-viewer X MALE, ./smplx-viewer H FEMALE
      • ./smplx-viewer will open plain neutral SMPL model (if available)
  • smplx-amass: AMASS viewer
    • Usage: ./smplx-amass model npz_path
      • All arguments are position and optional
      • model may be S/H/X, where S means SMPL, H means SMPL+H, X means SMPL-X. Note Xp (hand PCA) is not available for AMASS integration. Default H
      • npz_path: optionally, path to AMASS .npz to load on open
      • ./smplx-amass opens a blank viewer with option to browse for and load a npz
  • smplx-sdf: View SMPL SDF

Library usage

  • TBA, refer to examples (main_*.cpp) for now

License

This library is licensed under Apache v2 (non-copyleft). However, remember that the following are non-commercial research-only:

  • SMPL
  • SMPL-X
  • Mano/SMPL+H
  • AMASS dataset
  • SMPLify

References

[1] SMPL: http://smpl.is.tue.mpg.de. SMPL: A Skinned Multi-Person Linear Model. Matthew Loper, Naureen Mahmood, Javier Romero, Gerard Pons-Moll, Michael J. Black. 2015

[2] SMPLify: http://smplify.is.tue.mpg.de. Keep it SMPL: Automatic Estimation of 3D Human Pose and Shape from a Single Image. Federica Bogo*, Angjoo Kanazawa*, Christoph Lassner, Peter Gehler, Javier Romero, Michael Black. 2016

[3] Mano: http://mano.is.tue.mpg.de. Embodied Hands: Modeling and Capturing Hands and Bodies Together. Javier Romero*, Dimitrios Tzionas*, and Michael J Black. 2017

[4] SMPL-X: http://smpl-x.is.tue.mpg.de. Expressive Body Capture: 3D Hands, Face, and Body from a Single Image. G. Pavlakos*, V. Choutas*, N. Ghorbani, T. Bolkart, A. A. A. Osman, D. Tzionas and M. J. Black. 2019

[5] AMASS: https://amass.is.tue.mpg.de/. AMASS: Archive of Motion Capture as Surface Shapes. Mahmood, Naureen and Ghorbani, Nima and Troje, Nikolaus F. and Pons-Moll, Gerard and Black, Michael J.

Vendored 3rd party libraries

The following dependencies are included in the repo and don't need to be installed

More Repositories

1

svox2

Plenoxels: Radiance Fields without Neural Networks
Python
2,798
star
2

pixel-nerf

PixelNeRF Official Repository
Python
1,381
star
3

volrend

PlenOctree Volume Rendering (supports CUDA & fragment shader backends)
C++
608
star
4

plenoctree

PlenOctrees: NeRF-SH Training & Conversion
Python
420
star
5

sdf

Parallelized triangle mesh --> continuous signed distance field on CPU
C++
397
star
6

nerfvis

NeRF visualization library under construction
HTML
281
star
7

meshview

Simple OpenGL mesh/point cloud viewer
C++
113
star
8

avatar

Fitting SMPL human body model to depth images in CPU real-time (combining SMPLify, original Kinect; new version of OpenARK avatar)
C++
102
star
9

svox

PlenOctrees construction + rendering PyTorch CUDA extension
Python
77
star
10

nivalis

Desmos-like function plotter using webasm
C++
26
star
11

rgbdrec

Depth camera pose estimation utility, with common abstraction on top of COLMAP, ORB_SLAM2
C++
19
star
12

Quaternion-SR-UKF

a minimal header-only C++ square root UKF library, with support for quaternion state vectors
C++
16
star
13

watplot

Interactive waterfall plots for Breakthrough Listen data
C++
5
star
14

Jiggly

Django web app for generating Kahoot-like jigsaw/matching games from vocabulary lists. Contains a GUI for students to play the games from their own devices and a live scoreboard the teacher can show on a screen for the class to see who is ahead.
HTML
4
star
15

volrend_human

C++ Renderer for CS 184 Final Project - Humans/Animatable NeRF (Not polished)
C++
3
star
16

segtool

Simple OpenCV GrabCut GUI + PointRend wrapper
Python
3
star
17

OpenARK-Deps

OpenARK Dependency Installer for Windows. Installs a bunch of common computer vision-related packages.
NSIS
2
star
18

sxyu.github.io

Personal website free hosting
JavaScript
2
star
19

Colors-of-Harmony

Music-to-notation transcription program, presented at Startup Weekend Vancouver 2016 w/ Luofei Chen
C#
2
star
20

Hexane

An online calculator that supports calculations with significant figures. Designed for use by chemistry students and has an equation balancer, a molar mass calculator, etc. Math input field powered by MathQuill.
JavaScript
2
star
21

Cantus-Core

A .NET library for interpreting Cantus, my personal programming language that takes inspiration from Python and Matlab. This library can also be used for evaluating mathematical expressions. Note: this is a fun project I made a long time ago duing high school and is pretty buggy, if I am to design a language now I would do so very differently.
C#
1
star