Spaces:
Sleeping
Sleeping
Download src/data/skeleton/motion/utils.py from ceccurr/EquiFusion: direct link, hf CLI and curl.
- Browser
- Download file 470 Bytes
-
https://huggingface.co/spaces/ceccurr/EquiFusion/resolve/main/src/data/skeleton/motion/utils.py
- Command line
-
hf download hf://spaces/ceccurr/EquiFusion/src/data/skeleton/motion/utils.py
-
curl -L -o utils.py https://huggingface.co/spaces/ceccurr/EquiFusion/resolve/main/src/data/skeleton/motion/utils.py
470 Bytes
| def center_kpts_around_hip(kpts, hip_idx=0): | |
| #hip is always joint n0 in h36m regardless of number of joints considered | |
| center = kpts[..., hip_idx, :].unsqueeze(-2) #(n_frames, n_joints, 3) | |
| centered_kpts = kpts - center | |
| return centered_kpts, center | |
| def center_kpts_around_hip_and_drop_root(kpts, hip_idx=0): | |
| centered_kpts, center = center_kpts_around_hip(kpts.clone(), hip_idx) | |
| centered_kpts = centered_kpts[..., 1:, :] | |
| return centered_kpts |