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

Method __getitem__

eval_code/recons/datasets/eth3d.py:65–76  ·  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

63 return len(self.metadata[sequence_name])
64
65 def __getitem__(self, idx_N):
66 """Fetch item by index and a dynamic variable n_per_seq."""
67
68 # Different from most pytorch datasets,
69 # here we not only get index, but also a dynamic variable n_per_seq
70 # supported by DynamicBatchSampler
71
72 index, n_per_seq = idx_N
73 sequence_name = self.sequence_list[index]
74 metadata = self.metadata[sequence_name]
75 ids = np.random.choice(len(metadata), n_per_seq, replace=False)
76 return self.get_data(index=index, ids=ids)
77
78 def get_data(
79 self,

Callers

nothing calls this directly

Calls 1

get_dataMethod · 0.95

Tested by

no test coverage detected