Created
July 3, 2019 21:00
-
-
Save pbamotra/d42366d9ec7a07e2141c7057723dbd6d to your computer and use it in GitHub Desktop.
DALI-Post-1.1
This file contains hidden or 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 | |
def get_image_transforms() -> transforms.Compose: | |
""" | |
These transformations meant for data augmentation are a bottleneck | |
since all the operations are done on CPU and then the tensors are | |
copied to the GPU device. | |
""" | |
return transforms.Compose([ | |
transforms.RandomSizedCrop(224), | |
transforms.RandomHorizontalFlip(), | |
transforms.ToTensor(), | |
transforms.Normalize(mean=[0.485, 0.456, 0.406], | |
std=[0.229, 0.224, 0.225]) | |
]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment