9dcac66250b2d26d9b2505ad04841f3f4b8bc2a1,utils/datasets.py,ImageFolder,__getitem__,#ImageFolder#,39
Before Change
def __getitem__(self, index):
img_path = self.files[index % len(self.files)]
// Extract image
img = lycon.load(img_path)
img, _ = pad_to_square(img, 127)
// 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: 5
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: 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__
Project Name: philipperemy/keras-tcn
Commit Name: 0cfe82c6beb9a28a5ff7da81b86fa0e93c388f14
Time: 2019-11-20
Author: premy@cogent.co.jp
File Name: tasks/save_reload_model.py
Class Name:
Method Name: