Post some pretrained SMPLH onnx model, you can using a single onnx to generate smpl mesh for visualization.
(visualize script also provided, it's in 3D)
A simple usage:
python
import collections
import onnxruntime as rt
import torch
import numpy as np
from nosmpl.vis.vis_o3d import vis_mesh_o3d, Open3DVisualizer
import json
from alfred import print_shape
from nosmpl.utils import rot_mat_to_euler
def gen():
sess = rt.InferenceSession("smplh_sim.onnx")
for i in range(5):
body_pose = (
torch.randn([1, 63], dtype=torch.float32).clamp(0, 0.4).cpu().numpy()
)
left_hand_pose = (
torch.randn([1, 45], dtype=torch.float32).clamp(0, 0.4).cpu().numpy()
)
right_hand_pose = (
torch.randn([1, 45], dtype=torch.float32).clamp(0, 0.4).cpu().numpy()
)
outputs = sess.run(
None, {"body": body_pose, "lhand": left_hand_pose, "rhand": right_hand_pose}
)
vertices, joints, faces = outputs
vertices = vertices[0].squeeze()
joints = joints[0].squeeze()
faces = faces.astype(np.int32)
vis_mesh_o3d(vertices, faces)
As you can see, totally smpl-free, there is no SMPL related thing here, just onnx...
The `smplh_sim_w_orien.onnx` is the model with global orientation as input.