示例#1
0
    def transform_val(self, sample):

        composed_transforms = transforms.Compose([
            tr.FixScaleCrop(crop_size=self.args.crop_size),
            #tr.Normalize(mean=(0.485, 0.456, 0.406), std=(0.229, 0.224, 0.225)),
            tr.ToTensor()
        ])
        return composed_transforms(sample)
示例#2
0
    def transform_val(self, sample):

        composed_transforms = transforms.Compose([
            tr.FixScaleCrop(400),
            tr.Normalize(mean=self.source_dist['mean'],
                         std=self.source_dist['std']),
            tr.ToTensor(),
        ])
        return composed_transforms(sample)
示例#3
0
 def transform_tr(self, sample):
     composed_transforms = transforms.Compose([
         #tr.RandomHorizontalFlip(),
         #tr.RandomScaleCrop(base_size=self.base_size, crop_size=self.crop_size),
         ##tr.RandomGaussianBlur(),
         tr.FixScaleCrop(crop_size=self.crop_size),
         tr.Normalize(mean=(0.485, 0.456, 0.406),
                      std=(0.229, 0.224, 0.225)),
         tr.ToTensor()
     ])
     return composed_transforms(sample)
示例#4
0
    def transform_pair_val(self, sample):

        composed_transforms = transforms.Compose([
            tr.FixScaleCrop(400),
            tr.HorizontalFlip(),
            tr.GaussianBlur(),
            tr.Normalize(mean=self.source_dist['mean'],
                         std=self.source_dist['std'],
                         if_pair=True),
            tr.ToTensor(if_pair=True),
        ])
        return composed_transforms(sample)
示例#5
0
    def transform_tr(self, sample):
        composed_transforms = transforms.Compose([
            #tr.RandomHorizontalFlip(),

            # to make the image in the same batch has same shape
            tr.FixScaleCrop(crop_size=self.args.crop_size),

            #tr.RandomGaussianBlur(),
            #tr.Normalize(mean=(0.485, 0.456, 0.406), std=(0.229, 0.224, 0.225)),
            tr.ToTensor()
        ])
        return composed_transforms(sample)