Kyle Dampier commited on
Commit
60d926f
1 Parent(s): e82c862

changed order of the layout and added more descriptions

Browse files
Files changed (1) hide show
  1. app.py +7 -9
app.py CHANGED
@@ -9,7 +9,8 @@ import streamlit as st
9
  # st.set_page_config(layout="wide")
10
 
11
  st.write('# MNIST Digit Recognition')
12
- st.write('## Using a CNN `Keras` model')
 
13
 
14
  # Import Pre-trained Model
15
  model = tf.keras.models.load_model('mnist.h5')
@@ -34,16 +35,9 @@ canvas_result = st_canvas(
34
  )
35
 
36
  if canvas_result.image_data is not None:
37
- st.write('### Resized Image')
38
- st.write("The image needs to be resized, because it can only input 28x28 images")
39
- # st.image(canvas_result.image_data)
40
- # st.write(type(canvas_result.image_data))
41
- # st.write(canvas_result.image_data.shape)
42
- # st.write(canvas_result.image_data)
43
  im = ImageOps.grayscale(Image.fromarray(canvas_result.image_data.astype(
44
  'uint8'), mode="RGBA")).resize((28, 28))
45
- # img_data = im.
46
- st.image(im, width=28*9)
47
 
48
  data = img_to_array(im)
49
  data = data / 255
@@ -61,3 +55,7 @@ if canvas_result.image_data is not None:
61
  plt.title('Drawing Prediction')
62
  plt.ylim(0, 1)
63
  st.write(result)
 
 
 
 
 
9
  # st.set_page_config(layout="wide")
10
 
11
  st.write('# MNIST Digit Recognition')
12
+ st.write('## Using trained CNN `Keras` model')
13
+ st.write('To view how this model was trained go to the `Files and Versions` tab and download the `Week1.ipynb` notebook')
14
 
15
  # Import Pre-trained Model
16
  model = tf.keras.models.load_model('mnist.h5')
 
35
  )
36
 
37
  if canvas_result.image_data is not None:
38
+
 
 
 
 
 
39
  im = ImageOps.grayscale(Image.fromarray(canvas_result.image_data.astype(
40
  'uint8'), mode="RGBA")).resize((28, 28))
 
 
41
 
42
  data = img_to_array(im)
43
  data = data / 255
 
55
  plt.title('Drawing Prediction')
56
  plt.ylim(0, 1)
57
  st.write(result)
58
+
59
+ st.write('### Resized Image')
60
+ st.write("The image needs to be resized, because it can only input 28x28 images")
61
+ st.image(im, width=28*9)