ahmedosman / STAR

ECCV2020 - Official code repository for the paper : STAR - A Sparse Trained Articulated Human Body Regressor

Home Page:https://star.is.tue.mpg.de

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Input poses are not affecting the body model

pedro-patlan opened this issue · comments

Hi Ahmed,

Thank you for putting the effort into the STAR model, it is a great project.

I was trying to transition from SMPL to STAR, however, I realize that the input pose is not affecting the body model. So, I got back to one of your examples and I noticed you did a test with random poses (code line), and still got the same result when using your torch function at this line.

Do you know if there is an issue with the input poses or am I doing something wrong? Deformation with the betas is working as expected.

Here is the test code I'm using:

import numpy as np
import trimesh
import torch
import os
from star.pytorch import star
from torch.autograd import Variable

# Set the device
if torch.cuda.is_available():
    device = torch.device("cuda:0")
else:
    device = torch.device("cpu")
    print("WARNING: CPU only, this will be slow!")

betas = np.array([
            np.array([ 0.25176191, -3.0, 0.46747496, 0.89178988,
                      2.20098416, 0.26102114, -3.07428093, 0.55708514,
                      -3.94442258, -2.88552087])])

num_betas=10
batch_size=1
bodymodel = star.STAR(gender='male',num_betas=num_betas)

pose_np  = np.random.normal(0,2,(1,72))
# print('poses: ', pose_np)

# Random poses
poses = torch.cuda.FloatTensor(pose_np)
poses = Variable(poses,requires_grad=True)
betas = torch.cuda.FloatTensor(betas)
betas = Variable(betas,requires_grad=True)
trans = torch.cuda.FloatTensor(np.zeros((batch_size,3)))
trans = Variable(trans,requires_grad=True)
model = bodymodel(poses, betas,trans)
shaped = model.v_shaped

vertices = shaped.detach().cpu().numpy().squeeze()
faces = model.f
joints = model.J_transformed

mesh_tm = trimesh.Trimesh(vertices, faces, process=False) 
mesh_tm.show()

Thank you!

Pedro.

Hi Pedro ,

Thanks for your interest in STAR.

v_shaped visualizes the model shape in a T-pose.

To get the final vertices of STAR after both posing and shaping:

vertices = model.detach().cpu().numpy().squeeze()

instead of model.v_shaped above. This is similar to the line here

Could you try it out? and let me know

Thanks,
Ahmed

Thank you for your quick reply, and it is the way I was looking for. I appreciate the clarification.

Best!
Pedro.