Created
March 26, 2021 08:21
-
-
Save udithhaputhanthri/bdab0c74aa8d5a38b45c141d3401cad7 to your computer and use it in GitHub Desktop.
WGAN_scripts
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 zipfile | |
import os | |
if not os.path.isfile('celeba.zip'): | |
!mkdir data_faces && wget https://s3-us-west-1.amazonaws.com/udacity-dlnfd/datasets/celeba.zip | |
with zipfile.ZipFile("celeba.zip","r") as zip_ref: | |
zip_ref.extractall("data_faces/") | |
from torch.utils.data import DataLoader | |
transform = transforms.Compose([ | |
transforms.Resize((img_size,img_size)), | |
transforms.ToTensor(), | |
transforms.Normalize((0.5,0.5, 0.5),(0.5, 0.5, 0.5))]) | |
dataset = datasets.ImageFolder('data_faces', transform=transform) | |
data_loader = DataLoader(dataset,batch_size=batch_size,shuffle=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment