MCPcopy Create free account
hub / github.com/DragonisCV/RAM / __getitem__

Method __getitem__

ram/data/five_task_dataset.py:44–51  ·  view source on GitHub ↗
(self, index)

Source from the content-addressed store, hash-verified

42 random.shuffle(self.sample_ids)
43
44 def __getitem__(self, index):
45 sample_info = self.sample_ids[index]
46 dataset_idx = sample_info['dataset_idx']
47 sample_idx = sample_info['sample_idx']
48
49 sample = self.datasets[dataset_idx][sample_idx]
50 sample['degradation_type'] = torch.tensor(dataset_idx, dtype=torch.long)
51 return sample
52
53 def __len__(self):
54 return len(self.sample_ids)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected