Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- import numpy as np
- from keras.preprocessing import image
- PATH = os.getcwd()
- train_path = PATH+'/data/train/'
- train_batch = os.listdir(train_path)
- x_train = []
- # load train data
- for sample in train_data:
- img_path = train_path+sample
- x = image.load_img(img_path)
- # preprocessing disini
- x_train.append(x)
- test_path = PATH+'/data/test/'
- test_batch = os.listdir(test_path)
- x_test = []
- for sample in test_data:
- img_path = test_path+sample
- x = image.load_img(img_path)
- # preprocessing disini
- x_test.append(x)
- x_train = np.array(x_train)
- x_test = np.array(x_test)
Add Comment
Please, Sign In to add comment