Last active
September 7, 2020 16:12
-
-
Save MLWhiz/a55ccd51813ddba17a54aefd98a76ed9 to your computer and use it in GitHub Desktop.
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 | |
| from torchvision.datasets import ImageFolder | |
| traindir = "data/train/" | |
| t = transforms.Compose([ | |
| transforms.Resize(size=256), | |
| transforms.CenterCrop(size=224), | |
| transforms.ToTensor()]) | |
| train_dataset = ImageFolder(root=traindir,transform=t) | |
| print("Num Images in Dataset:", len(train_dataset)) | |
| print("Example Image and Label:", train_dataset[2]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment