Classifying cats versus dogs
The dataset is available on Kaggle (a data science and machine learning competitions platform)—https://www.kaggle.com/c/dogs-vs-cats-redux-kernels-edition. Follow the link to register on the website and download the dataset.
Getting and previewing the dataset
This time, our dataset will consist of a raw images stored on a disk. After downloading the images, I would suggest extracting them to a data folder called Hand-on-Computer-Vision-with-Julia
on your machine.
Let's get an understanding of the dataset by loading and previewing some of the images. If you have extracted both archives, your images should be located in the data/train
and data/test
folders. Every image has a prefix, cat
or dog
, corresponding to a class followed by a digit corresponding to a sequential number. This is shown in the following code:
using Images, ImageView, MXNet IMAGES_PATH = "data/train" single_img = joinpath(IMAGES_PATH, "cat.1.jpg") size(single_img) imshow(single_img)
This will give...