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

Function load_motion_tensor

motion_gating/mbench_render.py:39–50  ·  view source on GitHub ↗
(path: Path)

Source from the content-addressed store, hash-verified

37
38
39def load_motion_tensor(path: Path) -> torch.Tensor:
40 data = torch.load(path, map_location="cpu")
41 if isinstance(data, dict):
42 if "motion" in data:
43 data = data["motion"]
44 else:
45 raise ValueError(f"{path} contains a dict but no 'motion' field.")
46 if not torch.is_tensor(data):
47 data = torch.as_tensor(data)
48 if data.ndim != 2:
49 raise ValueError(f"Expected a 2D motion tensor in {path}, got shape {tuple(data.shape)}")
50 return data.float()
51
52
53def run_smplx(

Callers 1

convert_and_renderFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected