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

Method __getitem__

eval_code/recons/datasets/nrgbd.py:102–113  ·  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

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

Callers

nothing calls this directly

Calls 1

get_dataMethod · 0.95

Tested by

no test coverage detected