MCPcopy Create free account
hub / github.com/XLearning-SCU/2022-CVPR-DART / TestData

Class TestData

data_loader.py:361–380  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

359
360
361class TestData(data.Dataset):
362 def __init__(self, test_img_file, test_label, transform=None, img_size=(144, 288)):
363 test_image = []
364 for i in range(len(test_img_file)):
365 img = Image.open(test_img_file[i])
366 img = img.resize((img_size[0], img_size[1]), Image.ANTIALIAS)
367 pix_array = np.array(img)
368 test_image.append(pix_array)
369 test_image = np.array(test_image)
370 self.test_image = test_image
371 self.test_label = test_label
372 self.transform = transform
373
374 def __getitem__(self, index):
375 img1, target1 = self.test_image[index], self.test_label[index]
376 img1 = self.transform(img1)
377 return img1, target1
378
379 def __len__(self):
380 return len(self.test_image)
381
382
383def load_data(input_data_path):

Callers 2

run.pyFile · 0.90
test.pyFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected