Skip to content

Instantly share code, notes, and snippets.

@aribornstein
Created May 20, 2021 16:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aribornstein/f97e3f572d2872a0f0a0d84af2f5a64f to your computer and use it in GitHub Desktop.
Save aribornstein/f97e3f572d2872a0f0a0d84af2f5a64f to your computer and use it in GitHub Desktop.
transform = {
"pre_tensor_transform": torchvision.transforms.Resize(size), # pil image
"to_tensor_transform": kornia.augmentations.ImageToTensor(), # tensors
"post_tensor_transform": kornia.augmentations.Normalize(mean, std),
"per_batch_transform": kornia.augmentations.ColorJitter(brightness=0.4),
"collate": default_collate,
"per_batch_transform_on_device": kornia.augmentations.RandomAffine(degrees=40.)
}
preprocess = CustomPreprocess(
train_transform=transform,
val_transform=transform,
test_transform=transform,
predict_transform=transform)
return None
def train_default_transforms(self):
return None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment