9dcac66250b2d26d9b2505ad04841f3f4b8bc2a1,utils/datasets.py,ImageFolder,__getitem__,#ImageFolder#,39
Before Change
// Resize
img = lycon.resize(img, height=self.img_size, width=self.img_size, interpolation=lycon.Interpolation.NEAREST)
// Channels-first
img = np.transpose(img, (2, 0, 1))
// As pytorch tensor
img = torch.from_numpy(img).float() / 255.0
return img_path, img
After Change
def __getitem__(self, index):
img_path = self.files[index % len(self.files)]
// Extract image as PyTorch tensor
img = transforms.ToTensor()(Image.open(img_path))
// Pad to square resolution
img, _ = pad_to_square(img, 0)
// Resize
img = resize(img, self.img_size)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances
Project Name: eriklindernoren/PyTorch-YOLOv3
Commit Name: 9dcac66250b2d26d9b2505ad04841f3f4b8bc2a1
Time: 2019-04-30
Author: eriklindernoren@live.se
File Name: utils/datasets.py
Class Name: ImageFolder
Method Name: __getitem__
Project Name: milesial/Pytorch-UNet
Commit Name: 4af6e54bd4e1c642282fe512d97aa5a09ce16fca
Time: 2018-06-16
Author: ziyuantony@gmail.com
File Name: predict.py
Class Name:
Method Name: predict_img
Project Name: eriklindernoren/PyTorch-YOLOv3
Commit Name: b591a7aecce5b8de42a0dd7bba62780675d34fce
Time: 2019-04-30
Author: eriklindernoren@live.se
File Name: utils/datasets.py
Class Name: ImageFolder
Method Name: __getitem__