January 2018
Intermediate to advanced
310 pages
7h 48m
English
For the purpose of classification, we will download the data from kaggle and store in an appropriate format. Sign up and log in to www.kaggle.com and go to https://www.kaggle.com/c/dogs-vs-cats/data. Download the train.zip and test1.zip files from that page. The train.zip file contains 25,000 images of pet data. We will use only a portion of the data to train a model. Readers with more computing power, such as a Graphics Processing Unit (GPU), can use more data than suggested. Run the following script to rearrange the images and create the necessary folders:
import os import shutil work_dir = '' # give your correct directory image_names = sorted(os.listdir(os.path.join(work_dir, 'train'))) def copy_files(prefix_str, range_start, ...
Read now
Unlock full access