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

Method __getitem__

eval_code/recons/datasets/sevenscenes.py:99–110  ·  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

97 return self.metadata[sequence_name]
98
99 def __getitem__(self, idx_N):
100 """Fetch item by index and a dynamic variable n_per_seq."""
101
102 # Different from most pytorch datasets,
103 # here we not only get index, but also a dynamic variable n_per_seq
104 # supported by DynamicBatchSampler
105
106 index, n_per_seq = idx_N
107 sequence_name = self.sequence_list[index]
108 metadata = self.metadata[sequence_name]
109 ids = np.random.choice(len(metadata), n_per_seq, replace=False)
110 return self.get_data(index=index, ids=ids)
111
112 def get_data(
113 self,

Callers

nothing calls this directly

Calls 1

get_dataMethod · 0.95

Tested by

no test coverage detected