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 lines910111213141518 unmodified lines3435363738394041424344454647484911 unmodified lines6162638 unmodified lines# st.set_page_config(layout="wide")st.write('# MNIST Digit Recognition')st.write('## Using a CNN `Keras` model')# 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 linesplt.title('Drawing Prediction')plt.ylim(0, 1)st.write(result)8 unmodified lines91011121314151618 unmodified lines35363738394041424311 unmodified lines555657585960618 unmodified lines# st.set_page_config(layout="wide")st.write('# MNIST Digit Recognition')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:im = ImageOps.grayscale(Image.fromarray(canvas_result.image_data.astype('uint8'), mode="RGBA")).resize((28, 28))data = img_to_array(im)data = data / 25511 unmodified linesplt.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