f0f56c2e15da58d1d191d936ee85a61021ab2c9d,pytorch/ade20k_dataset.py,ADE20KSegmentation,__getitem__,#ADE20KSegmentation#Any#,53

Before Change


        img_path = self.files[self.split][index].rstrip()
        lbl_path = img_path[:-4] + "_seg.png"

        img = m.imread(img_path)
        img = np.array(img, dtype=np.uint8)

        lbl = m.imread(lbl_path)
        lbl = np.array(lbl, dtype=np.int32)

After Change


        assert (len(self.images) == len(self.masks))

    def __getitem__(self, index):
        img = Image.open(self.images[index]).convert("RGB")
        mask = Image.open(self.masks[index])

        if self.mode == "train":
            img, mask = self._sync_transform(img, mask)
        elif self.mode == "val":
            img, mask = self._val_sync_transform(img, mask)
        else:
            assert self.mode == "testval"
            img, mask = self._img_transform(img), self._mask_transform(mask)

        if self.transform is not None:
            img = self.transform(img)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


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: nilearn/nilearn
Commit Name: 9b9095f877f603d91495c72f91e4fddf61f1724e
Time: 2019-07-22
Author: jerome@dockes.org
File Name: examples/02_decoding/plot_haxby_stimuli.py
Class Name:
Method Name:


Project Name: bethgelab/foolbox
Commit Name: 6b5aa515e09e44f73439b07a8ac1079aaf9af440
Time: 2017-11-03
Author: git@jonasrauber.de
File Name: foolbox/utils.py
Class Name:
Method Name: imagenet_example