Mr00Magician's picture
Update app.py
2ba0f38
raw history blame
No virus
611 Bytes
import gradio as gr
from tensorflow import keras as k
import numpy as np
loaded_SNN = k.models.load_model('SequentialNN.h5')
def predict(img):
img_array = np.array(img)
img_array = np.array(img_array, dtype = 'int32').reshape(1, 28, 28)
pred = loaded_SNN.predict([img_array])
return np.argmax(pred)
iface = gr.Interface(predict, inputs = 'sketchpad',
outputs = 'text',
allow_flagging = 'never',
description = 'Draw a Digit Below... (Draw in the centre for best results)')
iface.launch(share = True, width = 500, height = 500)