MCPcopy Create free account
hub / github.com/Royalvice/DocDiff / __getitem__

Method __getitem__

data/docdata.py:40–56  ·  view source on GitHub ↗
(self, idx)

Source from the content-addressed store, hash-verified

38 return len(self.data_gt)
39
40 def __getitem__(self, idx):
41
42 gt = Image.open(os.path.join(self.path_gt, self.data_img[idx]))
43 img = Image.open(os.path.join(self.path_img, self.data_img[idx]))
44 img = img.convert('RGB')
45 gt = gt.convert('RGB')
46 if self.mode == 1:
47 seed = torch.random.seed()
48 torch.random.manual_seed(seed)
49 img = self.ImgTrans[0](img)
50 torch.random.manual_seed(seed)
51 gt = self.ImgTrans[1](gt)
52 else:
53 img= self.ImgTrans(img)
54 gt = self.ImgTrans(gt)
55 name = self.data_img[idx]
56 return img, gt, name

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected