MCPcopy Create free account
hub / github.com/MotrixLab/ViMoGen / load_motion_tensor

Function load_motion_tensor

scripts/prepare_training_data.py:10–21  ·  view source on GitHub ↗

Load motion tensor from .pt or .npy file.

(motion_path)

Source from the content-addressed store, hash-verified

8
9
10def load_motion_tensor(motion_path):
11 """Load motion tensor from .pt or .npy file."""
12 if motion_path.endswith(".pt"):
13 motion = torch.load(motion_path, weights_only=True, map_location="cpu")
14 elif motion_path.endswith(".npy"):
15 motion = torch.from_numpy(np.load(motion_path)).float()
16 else:
17 raise ValueError(f"Unsupported motion file format: {motion_path}")
18
19 if isinstance(motion, dict):
20 motion = motion["motion"]
21 return motion
22
23
24def compute_statistics(data_list, num_workers=8):

Callers 1

load_single_motionFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected