Spaces:
Runtime error
Runtime error
Kyle Dampier commited on
Commit ·
60d926f
1
Parent(s): e82c862
changed order of the layout and added more descriptions
Browse files8 unmodified lines9101112121314151618 unmodified lines353637373839404142383940454641424311 unmodified lines555657585960618 unmodified lines# st.set_page_config(layout="wide")
st.write('# MNIST Digit Recognition')st.write('## Using a CNN `Keras` model')st.write('## Using trained CNN `Keras` model')st.write('To view how this model was trained go to the `Files and Versions` tab and download the `Week1.ipynb` notebook')
# Import Pre-trained Modelmodel = tf.keras.models.load_model('mnist.h5')18 unmodified lines)
if canvas_result.image_data is not None: st.write('### Resized Image') st.write("The image needs to be resized, because it can only input 28x28 images") # st.image(canvas_result.image_data) # st.write(type(canvas_result.image_data)) # st.write(canvas_result.image_data.shape) # st.write(canvas_result.image_data)
im = ImageOps.grayscale(Image.fromarray(canvas_result.image_data.astype( 'uint8'), mode="RGBA")).resize((28, 28)) # img_data = im. st.image(im, width=28*9)
data = img_to_array(im) data = data / 25511 unmodified lines plt.title('Drawing Prediction') plt.ylim(0, 1) st.write(result)
st.write('### Resized Image') st.write("The image needs to be resized, because it can only input 28x28 images") st.image(im, width=28*9)app.py+7-9