Basically I'm trying to figure out how to store my image data set for machine learning in an effective format. Right now, I figured out how to save my training images, test images and labels as numpy arrays in a .npz file, but I was hoping to figure out how to store the images in the style of the mnist data base. My images are sized (128, 128) and have 3 color channels. Is there a way to convert my image data to a better format and gzip it for compression? Thank you.
This is my current way of storing the 11,500 images I have collected.
import numpy as np
def load_data():
print("Loading Recycle Data")
path = 'recycle_data_shuffled.npz'
recycle_data = np.load(path)
x_train, y_train = recycle_data['x_train'], recycle_data['y_train']
x_test, y_test = recycle_data['x_test'], recycle_data['y_test']
recycle_data.close()
return (x_train, y_train), (x_test, y_test)