Giter Club home page Giter Club logo

tf-smgl's Introduction

TensorFlow implementation of SMGL (A Skinned Multi-Garment Linear Model)

Installation

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

Build SMGL model

$ smgl-build --config <path-to-config:config> --path <path-to-save:pkl>

Run SMGL model

$ smgl --path <path-to-smgl:pkl> --smpl <path-to-smpl:pkl> --motion <path-to-poses:npz> --batch-size <batch-size:int=16> --shape-range <shape-range:int=0> --output <path-to-save:pc2>

Usage

import tensorflow as tf
from tf_smpl import SMPL
from tf_smgl import SMGL

smpl = SMPL("<path-to-smpl:pkl>")
smgl = SMGL("<path-to-smgl:pkl>")
# calculate SMPL vertices
v_body, body_dict = smpl(
  shapes=betas,
  poses=poses,
  trans=trans,
  includes=["J_transforms"]
)
# calculate body normals
v_normals = smpl.normals(v_body)
# calculate SMGL vertices
v_garment = smgl(
  shapes=betas, 
  poses=poses, 
  trans=trans, 
  body_dict=body_dict
)
# Calculate neighbours of SMPL with Outfit
v_indices = smpl.neighbours(v_body, v_garment)
# Fix collision errors
v_fixed = smgl.fix_collisions(v_garment, v_body, v_normals, v_indices=v_indices)

tf-smgl's People

Contributors

opendeeple avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

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.