MCPcopy Create free account
hub / github.com/NVIDIA/semantic-segmentation / __getitem__

Method __getitem__

datasets/nullloader.py:58–71  ·  view source on GitHub ↗
(self, index)

Source from the content-addressed store, hash-verified

56 label_transform=label_transform)
57
58 def __getitem__(self, index):
59 # return img, mask, img_name, scale_float
60 crop_size = cfg.DATASET.CROP_SIZE
61 if ',' in crop_size:
62 crop_size = [int(x) for x in crop_size.split(',')]
63 else:
64 crop_size = int(crop_size)
65 crop_size = [crop_size, crop_size]
66
67 img = torch.FloatTensor(np.zeros([3] + crop_size))
68 mask = torch.LongTensor(np.zeros(crop_size))
69 img_name = f'img{index}'
70 scale_float = 0.0
71 return img, mask, img_name, scale_float
72
73 def __len__(self):
74 return 3000

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected