Mr00Magician
updated app.py
b8d6400
raw history blame
No virus
602 Bytes
import gradio as gr
from tensorflow import keras as k
import numpy as np
loaded_SNN = k.models.load_model('CNN.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)