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

Method __getitem__

data_loader.py:339–358  ·  view source on GitHub ↗
(self, index)

Source from the content-addressed store, hash-verified

337 ChannelExchange(gray=2)])
338
339 def __getitem__(self, index):
340
341 img1, target1, true_target1 = self.train_color_image[self.cIndex[index]], self.train_color_label[
342 self.cIndex[index]], self.true_train_color_label[self.cIndex[index]]
343 img2, target2, true_target2 = self.train_thermal_image[self.tIndex[index]], self.train_thermal_label[
344 self.tIndex[index]], self.true_train_thermal_label[self.tIndex[index]]
345
346 img1_0 = self.transform_color(img1)
347 img1_1 = self.transform_color1(img1)
348 img2 = self.transform_thermal(img2)
349
350 if self.mode == 'warmup':
351 return img1_0, img1_1, img2, target1, target2
352
353 elif self.mode == 'evaltrain':
354 return img1_0, img1_1, img2, target1, target2, self.cIndex[index], self.tIndex[index]
355
356 elif self.mode == 'train':
357 probV_1, probV_2, probI = self.probV_1[self.cIndex[index]], self.probV_2[self.cIndex[index]], self.probI[self.tIndex[index]]
358 return img1_0, img1_1, img2, target1, target2, true_target1, true_target2, probV_1, probV_2, probI
359
360
361class TestData(data.Dataset):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected