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
return
def __getitem__(self, index):
if self.dataset_size == self.A_size:
data_A = self.load_img(self.A[index], self.input_dim_A)
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: 4
Non-data size: 6
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: cornellius-gp/gpytorch
Commit Name: 9b664bd7cd8dbb9657626166ba61887ed06774d7
Time: 2017-09-13
Author: gpleiss@gmail.com
File Name: gpytorch/utils/toeplitz.py
Class Name:
Method Name: index_coef_to_sparse
Project Name: rusty1s/pytorch_geometric
Commit Name: e2db3b3f1d3d23cd5bc1e295835e0f4b33e95447
Time: 2018-03-07
Author: matthias.fey@tu-dortmund.de
File Name: examples/cora_gcn.py
Class Name:
Method Name:
Project Name: AllenCellModeling/pytorch_fnet
Commit Name: ba30f0665150fe300e34be8117108f1fdd8fadbd
Time: 2017-06-19
Author: chek.o@outlook.com
File Name: models.py
Class Name: Model
Method Name: predict