Skip to content

Commit

Permalink
test image reshaping
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhallinan88 committed Apr 15, 2020
1 parent 5b7f6d6 commit 4ea5d91
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ def mnist():

img = Image.open(data)
img_arr = np.array(img, dtype='float32')
#with open('shapes.log','w') as fh:
# fh.write("Shape: {}\n".format(img_arr.shape))
# rgb_weights = [0.2989, 0.5870, 0.1140]
# grayscale_image = np.dot(img_arr[...,:3], rgb_weights)
# fh.write("Gray Shape: {}".format(grayscale_image.shape))
img_arr_sh = img_arr.reshape(1, 28, 28, 1)
prediction = model.predict(img_arr_sh)
result = np.argmax(prediction)
Expand Down

0 comments on commit 4ea5d91

Please sign in to comment.