Perform the following steps:
- We'll start by loading the necessary libraries to download, unzip, and save CIFAR-10 images:
import os import tarfile import _pickle as cPickle import numpy as np import urllib.request import scipy.miscfrom imageio import imwrite
- We now declare the CIFAR-10 data link and create the temporary directory we will store the data in. We'll also declare the ten categories to reference when saving the images later on:
cifar_link = 'https://www.cs.toronto.edu/~kriz/cifar-10-python.tar.gz' data_dir = 'temp' if not os.path.isdir(data_dir): os.makedirs(data_dir) objects = ['airplane', 'automobile', 'bird', 'cat', 'deer', 'dog', 'frog', 'horse', 'ship', 'truck']
- Now we'll download the CIFAR-10 .tar data ...