dcd394f4a5bddb1fc97ae4a7224e00147fc110a3,examples/data_augmentation.py,DummyDataset,__getitem__,#DummyDataset#Any#,30

Before Change



    def __getitem__(self, idx):
        // get data sample
        sample = self.data_index[idx]

        // load data, NOTE: modify by cv2.imread(...)
        image = torch.rand(3, 240, 320)
        label = torch.rand(1, 240, 320)

After Change


    def __len__(self):
        return 4

    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)

        return img, target


// Utils functions
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 14

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: osmr/imgclsmob
Commit Name: f0f56c2e15da58d1d191d936ee85a61021ab2c9d
Time: 2019-03-21
Author: osemery@gmail.com
File Name: pytorch/ade20k_dataset.py
Class Name: ADE20KSegmentation
Method Name: __getitem__


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__