MCPcopy Index your code
hub / github.com/OpenMotionLab/MotionGPT / __init__

Method __init__

mGPT/data/Kit.py:11–46  ·  view source on GitHub ↗
(self, cfg, **kwargs)

Source from the content-addressed store, hash-verified

9
10class KitDataModule(HumanML3DDataModule):
11 def __init__(self, cfg, **kwargs):
12
13 super().__init__(cfg, **kwargs)
14
15 # Basic info of the dataset
16 self.name = "kit"
17 self.njoints = 21
18
19 # Path to the dataset
20 data_root = cfg.DATASET.KIT.ROOT
21 self.hparams.data_root = data_root
22 self.hparams.text_dir = pjoin(data_root, "texts")
23 self.hparams.motion_dir = pjoin(data_root, 'new_joint_vecs')
24
25 # Mean and std of the dataset
26 dis_data_root = pjoin(cfg.DATASET.KIT.MEAN_STD_PATH, 'kit',
27 "VQVAEV3_CB1024_CMT_H1024_NRES3", "meta")
28 self.hparams.mean = np.load(pjoin(dis_data_root, "mean.npy"))
29 self.hparams.std = np.load(pjoin(dis_data_root, "std.npy"))
30
31 # Mean and std for fair evaluation
32 dis_data_root_eval = pjoin(cfg.DATASET.KIT.MEAN_STD_PATH, 't2m',
33 "Comp_v6_KLD005", "meta")
34 self.hparams.mean_eval = np.load(pjoin(dis_data_root_eval, "mean.npy"))
35 self.hparams.std_eval = np.load(pjoin(dis_data_root_eval, "std.npy"))
36
37 # Length of the dataset
38 self.hparams.max_motion_length = cfg.DATASET.KIT.MAX_MOTION_LEN
39 self.hparams.min_motion_length = cfg.DATASET.KIT.MIN_MOTION_LEN
40 self.hparams.max_text_len = cfg.DATASET.KIT.MAX_TEXT_LEN
41 self.hparams.unit_length = cfg.DATASET.KIT.UNIT_LEN
42
43 # Get additional info of the dataset
44 self._sample_set = self.get_sample_set(overrides={"split": "test", "tiny": True})
45 self.nfeats = self._sample_set.nfeats
46 cfg.DATASET.NFEATS = self.nfeats
47
48 def feats2joints(self, features):
49 mean = torch.tensor(self.hparams.mean).to(features)

Callers

nothing calls this directly

Calls 1

get_sample_setMethod · 0.80

Tested by

no test coverage detected