fad73753f836de5cdd08d8e23d26c1170d19b386,src/dataset_unpair.py,dataset_unpair,__getitem__,#dataset_unpair#Any#,21
Before Change
def __getitem__(self, index):
crop_img = self.load_img(self.images[index], flip=self.flip, random_crop=True)
raw_data = crop_img.transpose((2, 0, 1))
data = ((torch.FloatTensor(raw_data) / 255.0) - 0.5) * 2
return data
def load_img(self, img_name, flip=False, random_crop=False):
if self.input_dim == 3:
After Change
data_B = self.load_img(self.B[random.randint(0, self.B_size - 1)], self.input_dim_B)
else:
data_A = self.load_img(self.A[random.randint(0, self.A_size - 1)], self.input_dim_A)
data_B = self.load_img(self.B[index], self.input_dim_B)
return data_A, data_B
def load_img(self, img_name, input_dim):
img = Image.open(img_name).convert("RGB")
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances
Project Name: HsinYingLee/DRIT
Commit Name: fad73753f836de5cdd08d8e23d26c1170d19b386
Time: 2018-04-09
Author: hytseng0509@gmail.com
File Name: src/dataset_unpair.py
Class Name: dataset_unpair
Method Name: __getitem__
Project Name: IBM/adversarial-robustness-toolbox
Commit Name: fb4fbbb89295814079df2dace8340383dafe70a6
Time: 2017-07-24
Author: valentina.zantedeschi@ibm.com
File Name: generate_from_imagenet.py
Class Name:
Method Name:
Project Name: IBM/adversarial-robustness-toolbox
Commit Name: 4d586ecdb5f85be5d830b5b4982ec4b685d175d8
Time: 2017-07-24
Author: valentina.zantedeschi@ibm.com
File Name: generate_from_imagenet.py
Class Name:
Method Name: