Skip to content

Instantly share code, notes, and snippets.

@udithhaputhanthri
Last active May 16, 2020 03:33
Show Gist options
  • Save udithhaputhanthri/fa8ad91b2a422d94da42bd35c7197c84 to your computer and use it in GitHub Desktop.
Save udithhaputhanthri/fa8ad91b2a422d94da42bd35c7197c84 to your computer and use it in GitHub Desktop.
Introduction to DCGAN using PyTorch
import zipfile
!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()])
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