MCPcopy Create free account
hub / github.com/KeepTryingTo/Pytorch-GAN / __getitem__

Method __getitem__

Code/datasets.py:33–47  ·  view source on GitHub ↗
(self, index)

Source from the content-addressed store, hash-verified

31 return self.length_dataset
32
33 def __getitem__(self, index):
34 vango_img = self.vango_Images[index % self.vango_len]
35 photo_img = self.photo_Images[index % self.photo_len]
36
37 vango_path = os.path.join(self.root_vango,vango_img)
38 photo_path = os.path.join(self.root_photo,photo_img)
39
40 vango_img = np.array(Image.open(vango_path).convert("RGB"))
41 photo_img = np.array(Image.open(photo_path).convert("RGB"))
42
43 if self.transform:
44 argumentation = self.transform(image = vango_img,image0 = photo_img)
45 vango_img = argumentation["image"]
46 photo_img = argumentation["image0"]
47 return vango_img,photo_img
48
49

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected