Loading the dataset

Loading the dataset is a process that takes several steps. Let's explore each step one by one.

  1. The first step is to load the class IDs, which are stored in a pickle file. The following code will load the class IDs and return a list of all of them:
def load_class_ids(class_info_file_path):    """    Load class ids from class_info.pickle file    """    with open(class_info_file_path, 'rb') as f:        class_ids = pickle.load(f, encoding='latin1')        return class_ids
  1. Next, load the filenames, which are also stored in a pickle file. This can be done as follows:
def load_filenames(filenames_file_path):    """    Load filenames.pickle file and return a list of all file names    """    with open(filenames_file_path, 'rb') as f: filenames = pickle.load(f, ...

Get Generative Adversarial Networks Projects now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.