Datasets:
Download load_motion.py from Kyry10/h2-dances: direct link, hf CLI and curl.
- Browser
- Download file 526 Bytes
-
https://huggingface.co/datasets/Kyry10/h2-dances/resolve/main/load_motion.py
- Command line
-
hf download hf://datasets/Kyry10/h2-dances/load_motion.py
-
curl -L -o load_motion.py https://huggingface.co/datasets/Kyry10/h2-dances/resolve/main/load_motion.py
526 Bytes
| """Inspect a H2 reference motion: python load_motion.py motions/<clip>.npz""" | |
| import sys | |
| import numpy as np | |
| with np.load(sys.argv[1], allow_pickle=False) as clip: | |
| qpos = clip['qpos'] | |
| fps = float(clip['fps']) | |
| print(f'{len(qpos)} frames, {fps:g} fps, {len(qpos)/fps:.2f} seconds') | |
| root_xyz, root_wxyz, joints = qpos[:, :3], qpos[:, 3:7], qpos[:, 7:] | |
| print('root XYZ:', root_xyz.shape, 'root WXYZ:', root_wxyz.shape, 'joint radians:', joints.shape) | |
| print('joints:', [str(n) for n in clip['joint_names']]) | |