MCPcopy Create free account
hub / github.com/InternRobotics/G2VLM / __getitem__

Method __getitem__

eval_code/recons/datasets/co3d_v2.py:208–219  ·  view source on GitHub ↗

Fetch item by index and a dynamic variable n_per_seq.

(self, idx_N)

Source from the content-addressed store, hash-verified

206 return len(self.metadata[sequence_name])
207
208 def __getitem__(self, idx_N):
209 """Fetch item by index and a dynamic variable n_per_seq."""
210
211 # Different from most pytorch datasets,
212 # here we not only get index, but also a dynamic variable n_per_seq
213 # supported by DynamicBatchSampler
214
215 index, n_per_seq = idx_N
216 sequence_name = self.sequence_list[index]
217 metadata = self.metadata[sequence_name]
218 ids = np.random.choice(len(metadata), n_per_seq, replace=False)
219 return self.get_data(index=index, ids=ids)
220
221 def get_data(
222 self,

Callers

nothing calls this directly

Calls 1

get_dataMethod · 0.95

Tested by

no test coverage detected