MCPcopy Create free account
hub / github.com/SLDGroup/EMCAD / __init__

Method __init__

utils/dataloader.py:140–153  ·  view source on GitHub ↗
(self, image_root, gt_root, testsize)

Source from the content-addressed store, hash-verified

138
139class test_dataset:
140 def __init__(self, image_root, gt_root, testsize):
141 self.testsize = testsize
142 self.images = [image_root + f for f in os.listdir(image_root) if f.endswith('.jpg') or f.endswith('.png')]
143 self.gts = [gt_root + f for f in os.listdir(gt_root) if f.endswith('.tif') or f.endswith('.png' or f.endswith('.jpg'))]
144 self.images = sorted(self.images)
145 self.gts = sorted(self.gts)
146 self.transform = transforms.Compose([
147 transforms.Resize((self.testsize, self.testsize)),
148 transforms.ToTensor(),
149 transforms.Normalize([0.485, 0.456, 0.406],
150 [0.229, 0.224, 0.225])])
151 self.gt_transform = transforms.ToTensor()
152 self.size = len(self.images)
153 self.index = 0
154
155 def load_data(self):
156 image = self.rgb_loader(self.images[self.index])

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected