예제 #1
0
 def make_train_transform(self):
     return transforms.Compose([
         pt_util.ToPILImage(),
         transforms.RandomResizedCrop(self.size, scale=(0.2, 1.0)),
         transforms.RandomHorizontalFlip(),
         pt_util.ToTensor(scale=255),
         transforms.Normalize(mean=[0.485, 0.456, 0.406],
                              std=[0.229, 0.224, 0.225]),
     ])
예제 #2
0
 def make_val_transform(self):
     return transforms.Compose([
         pt_util.ToPILImage(),
         transforms.Resize(
             (int(self.size[0] / 0.875), int(self.size[1] / 0.875)),
             interpolation=Image.BILINEAR),
         transforms.CenterCrop(self.size),
         pt_util.ToTensor(scale=255),
         transforms.Normalize(mean=[0.485, 0.456, 0.406],
                              std=[0.229, 0.224, 0.225]),
     ])
예제 #3
0
 def make_train_transform(self):
     return transforms.Compose([
         transforms.RandomResizedCrop(self.size, scale=(0.08, 1.0)),
         transforms.ColorJitter(0.4, 0.4, 0.4, 0.2),
         # transforms.RandomResizedCrop(self.size, scale=(0.2, 1.0)),
         transforms.RandomGrayscale(p=0.2),
         # transforms.ColorJitter(0.4, 0.4, 0.4, 0.4),
         transforms.RandomHorizontalFlip(),
         pt_util.ToTensor(scale=255),
         transforms.Normalize(mean=[0.485, 0.456, 0.406],
                              std=[0.229, 0.224, 0.225]),
     ])
예제 #4
0
 def __init__(self, args, data_subset="train"):
     seqs = GOT10k(args.data_path, subset=data_subset, return_meta=True)
     self.cfg = args.cfg
     pair_transform = SiamFCTransforms(exemplar_sz=self.cfg["exemplar_sz"],
                                       instance_sz=self.cfg["instance_sz"],
                                       context=self.cfg["context"])
     if data_subset == "train":
         transform = transforms.Compose([
             transforms.RandomApply([transforms.Lambda(fliplr)], 0.5),
             pt_util.ToTensor(scale=255),
             transforms.Normalize(mean=[0.485, 0.456, 0.406],
                                  std=[0.229, 0.224, 0.225]),
         ])
     else:
         transform = transforms.Compose([
             pt_util.ToTensor(scale=255),
             transforms.Normalize(mean=[0.485, 0.456, 0.406],
                                  std=[0.229, 0.224, 0.225]),
         ])
     super(GOT10kDataset, self).__init__(args, seqs, data_subset,
                                         pair_transform, transform)
예제 #5
0
 def make_train_transform(self):
     return transforms.Compose([
         transforms.RandomResizedCrop(self.size, scale=(0.2, 1.0)),
         transforms.RandomGrayscale(p=0.2),
         transforms.ColorJitter(0.4, 0.4, 0.4, 0.4),
         transforms.RandomHorizontalFlip(),
         pt_util.ToTensor(scale=255),
         transforms.Normalize(mean=[0.485, 0.456, 0.406],
                              std=[0.229, 0.224, 0.225]),
         transforms.RandomApply(
             [util_functions.RandomGaussianBlur(self.size[0] // 10)],
             p=0.5),
     ])
예제 #6
0
 def make_train_transform(self):
     return transforms.Compose([
         pt_util.ToPILImage(),
         transforms.RandomResizedCrop(self.size,
                                      scale=(0.2, 1),
                                      ratio=(0.7, 1.4),
                                      interpolation=Image.BILINEAR),
         transforms.ColorJitter(0.4, 0.4, 0.4, 0.2),
         # transforms.RandomApply([transforms.ColorJitter(0.4, 0.4, 0.4, 0.4)], p=0.8),
         transforms.RandomGrayscale(p=0.2),
         transforms.RandomHorizontalFlip(),
         pt_util.ToTensor(scale=255),
         transforms.Normalize(mean=[0.485, 0.456, 0.406],
                              std=[0.229, 0.224, 0.225]),
     ])