Last active
October 2, 2023 07:46
-
-
Save Akash-Rawat/afdc38882b913b4edd1c07697f37d784 to your computer and use it in GitHub Desktop.
Data Preparation
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
import torch | |
import torchvision | |
from torchvision import transforms | |
data_transforms = transforms.Compose([ | |
transforms.Resize((224, 224)), | |
transforms.ToTensor(), | |
transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225]) | |
]) | |
data_dir = '/path/to/your/dataset' | |
image_datasets = torchvision.datasets.ImageFolder(data_dir, transform=data_transforms) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment