Learn practical skills, build real-world projects, and advance your career
alt

🌷 My GAN Gave Me Flowers

Image generation using the 102 Flower Categories dataset

###YouTube Video of 200 epochs of results

⇨ Importing the necessary libraries:

from torch.utils.data import DataLoader
from torchvision.datasets import ImageFolder
import torchvision.transforms as T
import torchvision.transforms.functional as TF
import PIL
import random
import tarfile
import os
from urllib.request import urlretrieve
from zipfile import ZipFile
import torch
from torchvision.utils import make_grid
import matplotlib.pyplot as plt
%matplotlib inline

⇨ Downloading and extracting the images:

data_url = "https://www.robots.ox.ac.uk/~vgg/data/flowers/102/102flowers.tgz"
urlretrieve(data_url, '102flowers.tgz')    
with tarfile.open('./102flowers.tgz', 'r:gz') as tar:
    tar.extractall(path='./data')