dcd394f4a5bddb1fc97ae4a7224e00147fc110a3,examples/data_augmentation.py,DummyDataset,__getitem__,#DummyDataset#Any#,30
Before Change
sample = self.data_index[idx]
// load data, NOTE: modify by cv2.imread(...)
image = torch.rand(3, 240, 320)
label = torch.rand(1, 240, 320)
return dict(images=image, labels=label)
////////////////////////////////////////////////////////////////
After Change
def __getitem__(self, index):
img = Image.open(self.images[index]).convert("RGB")
target = torch.load(self.targets[index])
ow, oh = img.size
// Reescale boxes
target[:2].mul_(512 / ow)
target[-2:].mul_(512 / oh)
// Reorder boxes as xyxy
perm = torch.LongTensor([0, 2, 1, 3])
target = target[perm]
if self.transforms is not None:
img = self.transforms(img)
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 5
Instances
Project Name: arraiy/torchgeometry
Commit Name: dcd394f4a5bddb1fc97ae4a7224e00147fc110a3
Time: 2020-01-15
Author: diegovd0296@gmail.com
File Name: examples/data_augmentation.py
Class Name: DummyDataset
Method Name: __getitem__
Project Name: arraiy/torchgeometry
Commit Name: 73317ca61e33b42353fc4b3010f586124954ca18
Time: 2019-12-19
Author: diegovd0296@gmail.com
File Name: examples/data_augmentation.py
Class Name: DummyDataset
Method Name: __getitem__
Project Name: asappresearch/sru
Commit Name: 6629a7801184d9ff646c266154a09e94d643c39d
Time: 2020-10-11
Author: hp@asapp.com
File Name: test/test_regression_2.py
Class Name:
Method Name: run
Project Name: asappresearch/sru
Commit Name: 2a15843223ac09c1331b1ca444da179ccab735d9
Time: 2020-10-07
Author: hp@asapp.com
File Name: test/test_regression_2.py
Class Name:
Method Name: run