MCPcopy
hub / github.com/OpenMotionLab/MotionGPT / collate_data3d

Function collate_data3d

mGPT/utils/tensors.py:59–74  ·  view source on GitHub ↗
(batch)

Source from the content-addressed store, hash-verified

57 return batch
58
59def collate_data3d(batch):
60 batchTensor = {}
61 for key in batch[0].keys():
62 databatch = [b[key] for b in batch]
63 if key == "paths":
64 batchTensor[key] = databatch
65 else:
66 batchTensor[key] = torch.stack(databatch,axis=0)
67 batch = batchTensor
68 # theta - [bs, lengths, 85], theta shape (85,)
69 # - (np.array([1., 0., 0.]), pose(72), shape(10)), axis=0)
70 # kp_2d - [bs, lengths, njoints, nfeats], nfeats (x,y,weight)
71 # kp_3d - [bs, lengths, njoints, nfeats], nfeats (x,y,z)
72 # w_smpl - [bs, lengths] zeros
73 # w_3d - [bs, lengths] zeros
74 return batch

Callers

nothing calls this directly

Calls 1

keysMethod · 0.80

Tested by

no test coverage detected