Prepare raw data for the f'{idx'}-th data.
(self, idx: int)
| 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 |
nothing calls this directly
no outgoing calls
no test coverage detected