Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

transform jpg image into array for conv2d

all_images = []
for image_path in os.listdir(path):
  img = io.imread(image_path , as_grey=True)
  img = img.reshape([WIDTH, HEIGHT, 1])
  all_images.append(img)
x_train = np.array(all_images)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #transform #jpg #image #array
ADD COMMENT
Topic
Name
1+8 =