April 2020
Intermediate to advanced
438 pages
12h 2m
English
First, download the anime face dataset from https://www.kaggle.com/splcher/animefacedataset (create a Kaggle account if you don't already have one) and extract the images into the anime sub-directory in the images directory (there are 63,565 images as of now). Import all the required packages using the following code block:
import numpy as npfrom PIL import Imageimport matplotlib.pylab as pltimport pickle as pklimport torchimport torch.nn as nnfrom torchvision import datasetsfrom torchvision import transformsfrom torch.utils.data.sampler import SubsetRandomSamplerimport torch.nn.functional as Fimport torch.optim as optim
Read now
Unlock full access