January 2019
Intermediate to advanced
316 pages
8h 16m
English
After downloading the dataset, extract the files in the data folder manually, or execute the following commands to extract the files:
# Move to data directorycd data# Extract wiki_crop.tartar -xvf wiki_crop.tar
The wiki_crop.tar file contains 62,328 images and a wiki.mat file that holds all the labels. The scipy.io library has a method called loadmat, which is a really handy method to load .mat files in Python. Use the following code to load extracted .mat files:
def load_data(wiki_dir, dataset='wiki'): # Load the wiki.mat file meta = loadmat(os.path.join(wiki_dir, "{}.mat".format(dataset))) # Load the list of all files full_path = meta[dataset][0, 0]["full_path"][0] # List of Matlab serial date numbers dob = meta[dataset][ ...
Read now
Unlock full access