Machine Learning with PyTorch and Scikit-Learn
-- Code Examples
Package version checks
Add folder to path in order to load from the check_packages.py script:
Check recommended package versions:
Chapter 14: Classifying Images with Deep Convolutional Neural Networks (Part 2/2)
Note that the optional watermark extension is a small IPython notebook plugin that I developed to make the code reproducible. You can just skip the following line(s).
Smile classification from face images using CNN
Loading the CelebA dataset
You can try setting download=True
in the code cell below, however due to the daily download limits of the CelebA dataset, this will probably result in an error. Alternatively, we recommend trying the following:
You can download the files from the official CelebA website manually (https://mmlab.ie.cuhk.edu.hk/projects/CelebA.html)
or use our download link, https://drive.google.com/file/d/1m8-EBPgi5MRubrm6iQjafK2QMHDBMSfJ/view?usp=sharing (recommended).
If you use our download link, it will download a celeba.zip
file,
which you need to unpack in the current directory where you are running the code.
In addition, please also make sure you unzip the
img_align_celeba.zip
file, which is inside theceleba
folder.Also, after downloading and unzipping the celeba folder, you need to run with the setting
download=False
instead ofdownload=True
(as shown in the code cell below).
For simplicity, you can also use my link here where I already prepared the directory structure: https://drive.google.com/file/d/1m8-EBPgi5MRubrm6iQjafK2QMHDBMSfJ/view?usp=share_link
Download that zip file and place it in the celeba
folder. Then unzip img_align_celeba.zip
. And it should work:
In case you are encountering problems with this approach, please do not hesitate to open a new issue or start a discussion at https://github.com/rasbt/machine-learning-book so that we can provide you with additional information.
Image transformation and data augmentation
Training a CNN Smile classifier
...
Summary
...
Readers may ignore the next cell.