exapnd generate function, not tested
This commit is contained in:
@@ -78,7 +78,26 @@ def step_pyramid(batch):
|
||||
|
||||
|
||||
def step(batch):
|
||||
return None
|
||||
if config['use_skinning']:
|
||||
uv_orig = batch['uv_unposed']
|
||||
else:
|
||||
uv_orig = batch['uv_posed']
|
||||
|
||||
model.eval()
|
||||
pred, _, _ = model([uv_orig, batch['uv_static'], batch['uv_body_posed'], batch['uv_normals'], batch['uv_mask']])
|
||||
mesh_pred = uv2mesh(pred)
|
||||
|
||||
if config['use_skinning']:
|
||||
shape = batch['pose_shape'][:, 72:]
|
||||
gender = torch.greater_equal(shape[:, 10] , 0.5).to(torch.long)
|
||||
shape_offsets = torch.stack([torch.tensordot(shape[i,:10][None, :], smpl.shapedirs[gender[i]], dims=[[1], [2]])[0,smpl.to_keep,:] for i in range(shape.shape[0])])
|
||||
|
||||
mesh_pred_shaped = mesh_pred + shape_offsets * batch['mesh_mask'][:,:,None]
|
||||
mesh_pred_posed = smpl(batch['pose_shape'][:, :72], batch['pose_shape'][:, 72:], mesh_pred_shaped)[0]
|
||||
else:
|
||||
mesh_pred_posed = mesh_pred
|
||||
|
||||
return mesh_pred_posed
|
||||
|
||||
|
||||
def generate():
|
||||
|
||||
Reference in New Issue
Block a user