Created
November 13, 2018 13:45
-
-
Save weklund/75615e1a25e5e2ba5416e9e6ef096429 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def load_dataset(path): | |
data = load_files(path, shuffle=True) | |
img_files = np.array(data['filenames']) | |
img_targets = np_utils.to_categorical(np.array(data['target']), 3) | |
return img_files, img_targets | |
train_files, train_labels = load_dataset('data/train') | |
valid_files, valid_labels = load_dataset('data/valid') | |
def load_dataset_no_shuffle(path): | |
data = load_files(path, shuffle=False) | |
img_files = np.array(data['filenames']) | |
img_targets = np_utils.to_categorical(np.array(data['target']), 3) | |
return img_files, img_targets | |
test_files , test_labels = load_dataset_no_shuffle('data/test') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment