MCPcopy Create free account
hub / github.com/MotrixLab/FineMoGen / prepare_data

Method prepare_data

mogen/datasets/text_motion_dataset.py:87–99  ·  view source on GitHub ↗

Prepare raw data for the f'{idx'}-th data.

(self, idx: int)

Source from the content-addressed store, hash-verified

85 return results
86
87 def prepare_data(self, idx: int):
88 """"Prepare raw data for the f'{idx'}-th data."""
89 results = copy.deepcopy(self.data_infos[idx])
90 text_list = results['text']
91 idx = np.random.randint(0, len(text_list))
92 results['text'] = text_list[idx]
93 if 'clip_feat' in results.keys():
94 results['clip_feat'] = results['clip_feat'][idx]
95 if 'token' in results.keys():
96 results['token'] = results['token'][idx]
97 results['dataset_name'] = self.dataset_name
98 results = self.pipeline(results)
99 return results

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected