32b9dcd002284d6bb16da626a4a5294c28098869,examples/data_augmentation.py,DummyDataset,__getitem__,#DummyDataset#Any#,33

Before 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)

        return img, target


// Utils functions
def plot_images(org, img):

After Change


        // 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)

////////////////////////////////////////////////////////////////
// 2. Define the data augmentation operations
// Thanks to the `kornia` design all the operators can be placed inside inside a `nn.Sequential`.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: arraiy/torchgeometry
Commit Name: 32b9dcd002284d6bb16da626a4a5294c28098869
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: b77efb1269d87560bc9f9e6016bcf77c53557448
Time: 2020-01-07
Author: diegovd0296@gmail.com
File Name: examples/data_augmentation.py
Class Name: DummyDataset
Method Name: __getitem__


Project Name: AIRLab-POLIMI/mushroom
Commit Name: c6bc2e28156b2582432c1e78117998bd1734c54e
Time: 2018-04-11
Author: carloderamo@gmail.com
File Name: mushroom/environments/atari.py
Class Name: Atari
Method Name: _preprocess_observation