Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bugs] Some problems of kinematic models. (face direction and kinematic chain modeling) #119

Open
IsshikiHugh opened this issue Jan 20, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@IsshikiHugh
Copy link

IsshikiHugh commented Jan 20, 2024

Thanks for your great work! When studying your wonderful motion representation, I found two small problem which might influence your effects. And they are all in common/skeleton.py.

1. Face Direction

This problem is already mentioned here: #112 #107. The direction of the across vector might be wrong.

l_hip, r_hip, sdr_r, sdr_l = face_joint_idx
across1 = joints[:, r_hip] - joints[:, l_hip]
across2 = joints[:, sdr_r] - joints[:, sdr_l]
across = across1 + across2
across = across / np.sqrt((across**2).sum(axis=-1))[:, np.newaxis]

Which is different from your code in motion_representation.ipynb.

" r_hip, l_hip, sdr_r, sdr_l = face_joint_indx\n",
" across1 = root_pos_init[r_hip] - root_pos_init[l_hip]\n",
" across2 = root_pos_init[sdr_r] - root_pos_init[sdr_l]\n",
" across = across1 + across2\n",
" across = across / np.sqrt((across ** 2).sum(axis=-1))[..., np.newaxis]\n",

This may lead to some errors, but thanks to the redundant 263-dimensional information, this can be recovered to a certain extent

2. Kinematic Chain

This problem may not be as serious as the above.

root_quat[0] = np.array([[1.0, 0.0, 0.0, 0.0]])
quat_params[:, 0] = root_quat
# quat_params[0, 0] = np.array([[1.0, 0.0, 0.0, 0.0]])
for chain in self._kinematic_tree:
R = root_quat
for j in range(len(chain) - 1):
# (batch, 3)
u = self._raw_offset_np[chain[j+1]][np.newaxis,...].repeat(len(joints), axis=0)
# print(u.shape)
# (batch, 3)
v = joints[:, chain[j+1]] - joints[:, chain[j]]
v = v / np.sqrt((v**2).sum(axis=-1))[:, np.newaxis]
# print(u.shape, v.shape)
rot_u_v = qbetween_np(u, v)
R_loc = qmul_np(qinv_np(R), rot_u_v)
quat_params[:,chain[j + 1], :] = R_loc
R = qmul_np(R, R_loc)

Here, each joints' position(except roots') will be converted to the rotation about it's parent along kinematic chain. However, not every chain start from root, which means line 85 is not very suitable especially for the arms' chains.

I thought it will be more suitable if it's like:

R = quat_params[:, chain[0]]

Again, thanks for your great work!

@EricGuo5513 EricGuo5513 pinned this issue Jan 20, 2024
@EricGuo5513
Copy link
Owner

Hi, thanks for pointing this out. Now it would be too late to change the code, since many people have done experiments on the obtained dataset. However, I will highlight your issue, so people will see your comments.

@EricGuo5513 EricGuo5513 added the bug Something isn't working label Jan 20, 2024
@IsshikiHugh
Copy link
Author

Hi, thanks for pointing this out. Now it would be too late to change the code, since many people have done experiments on the obtained dataset. However, I will highlight your issue, so people will see your comments.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants