09e424e235873182b5703eced5767970b1d030e9,loaders.py,MetadataImageSegmentationMultitaskDatasetInMemory,__getitem__,#MetadataImageSegmentationMultitaskDatasetInMemory#Any#,165

Before Change



    def __getitem__(self, index):
        Xi = self.X[0][index]
        if self.image_augment is not None:
            Xi = self.image_augment(Xi)

        if self.image_transform is not None:
            Xi = self.image_transform(Xi)

        if self.y is not None and self.train_mode:
            Mi = self.y[0][index]
            CTi = self.y[1][index]
            CRi = self.y[2][index]

            if self.image_augment is not None:
                Mi = self.image_augment(Mi)
                CTi = self.image_augment(CTi)
                CRi = self.image_augment(CRi)

            if self.mask_transform is not None:
                Mi = self.mask_transform(Mi)
                CTi = self.mask_transform(CTi)
                CRi = self.mask_transform(CRi)

            return Xi, Mi, CTi, CRi
        else:
            return Xi


class MetadataImageSegmentationLoader(BaseTransformer):
    def __init__(self, loader_params, dataset_params):

After Change


    def __len__(self):
        return len(self.X[0])

    def __getitem__(self, index):
        Xi = self.X[0][index]

        if self.y is not None:
            Mi = self.y[0][index]
            CTi = self.y[1][index]
            CRi = self.y[2][index]

            if self.train_mode and self.image_augment_with_target is not None:
                Xi, Mi, CTi, CRi = from_pil(Xi, Mi, CTi, CRi)
                Xi, Mi, CTi, CRi = self.image_augment_with_target(Xi, Mi, CTi, CRi)
                Xi = self.image_augment(Xi)
                Xi, Mi, CTi, CRi = to_pil(Xi, Mi, CTi, CRi)

            if self.mask_transform is not None:
                Mi = self.mask_transform(Mi)
                CTi = self.mask_transform(CTi)
                CRi = self.mask_transform(CRi)

            if self.image_transform is not None:
                Xi = self.image_transform(Xi)

            return Xi, Mi, CTi, CRi
        else:
            if self.image_transform is not None:
                Xi = self.image_transform(Xi)
            return Xi


class MetadataImageSegmentationLoader(BaseTransformer):
    def __init__(self, loader_params, dataset_params):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 29

Instances


Project Name: minerva-ml/open-solution-data-science-bowl-2018
Commit Name: 09e424e235873182b5703eced5767970b1d030e9
Time: 2018-02-09
Author: kamil-kaczmarek@users.noreply.github.com
File Name: loaders.py
Class Name: MetadataImageSegmentationMultitaskDatasetInMemory
Method Name: __getitem__


Project Name: minerva-ml/open-solution-data-science-bowl-2018
Commit Name: 09e424e235873182b5703eced5767970b1d030e9
Time: 2018-02-09
Author: kamil-kaczmarek@users.noreply.github.com
File Name: loaders.py
Class Name: MetadataImageSegmentationDatasetInMemory
Method Name: __getitem__


Project Name: minerva-ml/open-solution-data-science-bowl-2018
Commit Name: 09e424e235873182b5703eced5767970b1d030e9
Time: 2018-02-09
Author: kamil-kaczmarek@users.noreply.github.com
File Name: loaders.py
Class Name: MetadataImageSegmentationDataset
Method Name: __getitem__


Project Name: minerva-ml/open-solution-data-science-bowl-2018
Commit Name: 09e424e235873182b5703eced5767970b1d030e9
Time: 2018-02-09
Author: kamil-kaczmarek@users.noreply.github.com
File Name: loaders.py
Class Name: MetadataImageSegmentationMultitaskDataset
Method Name: __getitem__


Project Name: minerva-ml/open-solution-data-science-bowl-2018
Commit Name: 09e424e235873182b5703eced5767970b1d030e9
Time: 2018-02-09
Author: kamil-kaczmarek@users.noreply.github.com
File Name: loaders.py
Class Name: MetadataImageSegmentationMultitaskDatasetInMemory
Method Name: __getitem__