InterGen icon indicating copy to clipboard operation
InterGen copied to clipboard

Missing 3 joints from SMPL

Open xiaotangzh opened this issue 2 years ago • 2 comments

Hi,

Thanks for your work. Can I ask why the dimension of "pose_body" in the .pkl file is 63, which means 21 joints, rather than 24 joints in the SMPL model? I couldn't find the missing 3 joints or any skeleton hierarchy you used from the paper and the released codes. Thanks!

xiaotangzh avatar Jan 03 '24 23:01 xiaotangzh

"root_orient" is the rotation of the root joint, and the left two joints for the hands are omitted, and you can simply append zeros.

tr3e avatar Jan 04 '24 06:01 tr3e

Hello @tr3e,

Just appending to the end of array will work? Doesn't the order matter here? Are the last vectors in that flattened array for the hand or feet?

Currently, I'm trying to visualize pose_body data (63/3 = 21 joints) using:

import numpy as np
from scipy.spatial.transform import Rotation as R
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D

pose_body = train_data[0]['person1']['pose_body'][0]
pose_body = np.append(pose_body, [0, 0, 0, 0, 0, 0])
# Split into 21 rotation vectors (3 components each)
rotation_vectors = pose_body.reshape(-1, 3)

# Convert to rotation matrices
rotation_matrices = R.from_rotvec(rotation_vectors).as_matrix()

rest_pose = np.array([
    [0, 0, 0],  # Root
    [0, 1, 0],  # Spine
])

# Apply rotation matrices to the rest pose
transformed_pose = np.dot(rotation_matrices, rest_pose.T).T

# Now `transformed_pose` contains the 3D keypoints after applying rotations
x = transformed_pose[:, 0]
y = transformed_pose[:, 1]
z = transformed_pose[:, 2]

fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.scatter(x, y, z, c='r', marker='o')

ax.set_xlabel('X')
ax.set_ylabel('Y')
ax.set_zlabel('Z')

plt.show()

but doesn't look anything coherently like a skeleton. Is there something I'm missing?

I really appreciate your work here, super interesting dataset.

iThompkins avatar Aug 19 '24 01:08 iThompkins