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

Method __init__

data_loader.py:362–372  ·  view source on GitHub ↗
(self, test_img_file, test_label, transform=None, img_size=(144, 288))

Source from the content-addressed store, hash-verified

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]

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected