Last active
February 14, 2020 17:35
-
-
Save alankbi/b027ebaf6de535c3765ed50b7f6c07ce to your computer and use it in GitHub Desktop.
Data augmentation and DataLoaders with Detecto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from torchvision import transforms | |
augmentations = transforms.Compose([ | |
transforms.ToPILImage(), | |
transforms.RandomHorizontalFlip(0.5), | |
transforms.ColorJitter(saturation=0.5), | |
transforms.ToTensor(), | |
utils.normalize_transform(), | |
]) | |
dataset = core.Dataset('images/', transform=augmentations) | |
loader = core.DataLoader(dataset, batch_size=2, shuffle=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment