From 4ea5d91416a1d8e27bab69621affa1ee76a3cb5b Mon Sep 17 00:00:00 2001 From: "danielhallinan88@gmail.com" Date: Wed, 15 Apr 2020 03:57:14 +0000 Subject: [PATCH] test image reshaping --- app.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app.py b/app.py index bcd252d..c209e81 100644 --- a/app.py +++ b/app.py @@ -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)