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

How to create motion clip file (.npz) from other dataset #28

Open
tsbiosky opened this issue Feb 8, 2023 · 3 comments
Open

How to create motion clip file (.npz) from other dataset #28

tsbiosky opened this issue Feb 8, 2023 · 3 comments

Comments

@tsbiosky
Copy link

tsbiosky commented Feb 8, 2023

Great Work! It is amazing , May I ask what is the data structure of motion clip file. If I have some skeleton coordinates for each frame, how should I create a motion clip file for training ? Thanks

@xbpeng
Copy link
Collaborator

xbpeng commented Feb 8, 2023

if you have the global translation of the root, as well as the rotations for each joint. You can take a look at this example to create a poselib motion file:

new_sk_state = SkeletonState.from_rotation_and_root_translation(target_motion.skeleton_tree, local_rotation, root_translation, is_local=True)

You will first need to create a skeletonstate by passing the skeleton_tree of your character, the local rotations of the joints, and the root translation to SkeletonState.from_rotation_and_root_translation. Then you can create a skeletonmotion using SkeletonMotion.from_skeleton_state.

@tsbiosky
Copy link
Author

if you have the global translation of the root, as well as the rotations for each joint. You can take a look at this example to create a poselib motion file:

new_sk_state = SkeletonState.from_rotation_and_root_translation(target_motion.skeleton_tree, local_rotation, root_translation, is_local=True)

You will first need to create a skeletonstate by passing the skeleton_tree of your character, the local rotations of the joints, and the root translation to SkeletonState.from_rotation_and_root_translation. Then you can create a skeletonmotion using SkeletonMotion.from_skeleton_state.

Thank you for your reply!
I import skeleton tree from MJCF file but I notice the joint have only 3 axis and at each frame in my motion file the joints only have a rotation value along one axis , but why the local_rotaion need 4 dimensions and how should I get the root_translation for each frame?
In your code "from MJCF" , I saw the local_translation was read from "pos " of joint when creating skeleton tree from MJCF file . Is the root_translation means pos of root joint at each frame ? Here is a example of my motion data , Thanks

WeChat Image_20230220191549

@Murrol
Copy link

Murrol commented Mar 9, 2023

The 4 dimensions rotation is in quaternion. It's that your rotation is in euler angle. Root translation is the global root position.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants