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

Method __getitem__

mogen/datasets/base_dataset.py:85–95  ·  view source on GitHub ↗

Prepare data for the ``idx``-th data. As for video dataset, we can first parse raw data for each frame. Then we combine annotations from all frames. This interface is used to simplify the logic of video dataset and other special datasets.

(self, idx: int)

Source from the content-addressed store, hash-verified

83 return len(self.data_infos)
84
85 def __getitem__(self, idx: int):
86 """Prepare data for the ``idx``-th data.
87 As for video dataset, we can first parse raw data for each frame. Then
88 we combine annotations from all frames. This interface is used to
89 simplify the logic of video dataset and other special datasets.
90 """
91 if self.test_mode:
92 idx = self.eval_indexes[idx]
93 elif self.fixed_length is not None:
94 idx = idx % len(self.data_infos)
95 return self.prepare_data(idx)
96
97 def prepare_evaluation(self):
98 self.evaluators = []

Callers

nothing calls this directly

Calls 1

prepare_dataMethod · 0.95

Tested by

no test coverage detected