Git Product home page Git Product logo

tf-smpl's Introduction

TensorFlow implementation of SMPL (A Skinned Multi-Person Linear Model)

This repository contains the code to easy use SMPL with TensorFlow.

Installation

$ pip install git+https://github.com/opendeeple/tf-smpl.git

Download SMPL model

  • Sign in into https://smpl.is.tue.mpg.de
  • Download SMPL version 1.0.0 for Python 2.7 (10 shape PCs)
  • Extract SMPL_python_v.1.0.0.zip

Run

$ smpl --config configs/example.conf --motion motions\*.npz

Usage

import tensorflow as tf
from tf_smpl import SMPL

smpl = SMPL("<smpl_model_extraced_folder>/basicModel_f_lbs_10_207_0_v1.0.0.pkl")
# calculate SMPL vertices
batch_size = 16
v_body = smpl(
  shapes=tf.zeros(shape=[batch_size, 10]), # sample shapes (betas)
  poses=tf.zeros(shape=[batch_size, 72]), # sample poses
  trans=tf.zeros(shape=[batch_size, 3]) # sample trans
)
# calculate SMPL vertices for sequences
sequence_size = 3
v_body = smpl(
  shapes=tf.zeros(shape=[batch_size, sequence_size, 10]), # sample shapes (betas)
  poses=tf.zeros(shape=[batch_size, sequence_size, 72]), # sample poses
  trans=tf.zeros(shape=[batch_size, sequence_size, 3]) # sample trans
)

Calculate SMPL vertices with get middle variables

List of midle variables

  • v_shaped
  • v_posed
  • J_rotations
  • J_locations
  • J_transforms
v_body, body_dict = smpl(
  ...,
  includes=["v_shaped", "J_locations"] # for get middle variables
)
print(body_dict) # display body_dict:middle variables

Calculate SMPL normals

v_normals = smpl.normals(v_body)

Calculate neighbours of SMPL with Outfit

neighbours = smpl.neighbours(v_body, v_outfit)

tf-smpl's People

Contributors

opendeeple avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

clabra

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.