Delete tt.py
Browse files
tt.py
DELETED
|
@@ -1,19 +0,0 @@
|
|
| 1 |
-
import keras
|
| 2 |
-
import gradio as gr
|
| 3 |
-
|
| 4 |
-
model = keras.models.load_model("model.keras")
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
def recognize_digit(img):
|
| 8 |
-
img = img.reshape(1, 784)
|
| 9 |
-
img = img / 255
|
| 10 |
-
prediction = model.predict(img).tolist()[0]
|
| 11 |
-
return {str(i): prediction[i] for i in range(10)}
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
gr.Interface(
|
| 15 |
-
recognize_digit,
|
| 16 |
-
inputs=gr.Sketchpad(),
|
| 17 |
-
outputs=gr.Label(),
|
| 18 |
-
title="Predict from 0 to 9",
|
| 19 |
-
).launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|