Skip to content

Instantly share code, notes, and snippets.

@pranshuj73
Last active July 3, 2020 11:08
Show Gist options
  • Save pranshuj73/223a6b1bd57bbf5651c0f3c54e102175 to your computer and use it in GitHub Desktop.
Save pranshuj73/223a6b1bd57bbf5651c0f3c54e102175 to your computer and use it in GitHub Desktop.
# this is for the transforms
train_trfm = transforms.Compose(
[
transforms.ToPILImage(),
transforms.Grayscale(num_output_channels=1),
transforms.RandomCrop(48, padding=4, padding_mode='reflect'),
transforms.RandomHorizontalFlip(),
transforms.ToTensor(),
transforms.Normalize((0.5), (0.5), inplace=True)
])
val_trfm = transforms.Compose(
[
transforms.ToPILImage(),
transforms.Grayscale(num_output_channels=1),
transforms.ToTensor(),
transforms.Normalize((0.5), (0.5))
])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment