%% Download CIFAR-10
% This example shows how to download the CIFAR-10 data set to your computer. The CIFAR-10 data set is a labeled image data set commonly used for benchmarking image classification algorithms.
% Specify a local directory to download the data set to. The following code creates a folder in your current directory that contains all the images in the data set.

directory = pwd; 
[trainDirectory,testDirectory] = downloadCIFARToFolders(directory);

%
% After you download the data set, you can access it in MATLAB by using datastores.

imdsTrain = imageDatastore(trainDirectory, ...
 'IncludeSubfolders',true, ...
 'LabelSource','foldernames');

imdsTest = imageDatastore(testDirectory, ...
 'IncludeSubfolders',true, ...
 'LabelSource','foldernames');

% Copyright 2018 The MathWorks, Inc.