Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,12 +1,3 @@
|
|
1 |
-
import cv2
|
2 |
-
import gradio as gr
|
3 |
-
import tensorflow as tf
|
4 |
-
import numpy as np
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
# Model yükleniyor
|
9 |
-
model = tf.keras.models.load_model("number_recognition_model_colab.keras")
|
10 |
|
11 |
def predict(img):
|
12 |
# Preprocess the input image
|
@@ -18,15 +9,14 @@ def predict(img):
|
|
18 |
|
19 |
return predicted_digit
|
20 |
|
21 |
-
# Create the Gradio interface
|
22 |
with gr.Blocks() as demo:
|
23 |
gr.Markdown("Welcome on your first sketch recognition app!")
|
24 |
-
|
25 |
with gr.Row():
|
26 |
-
|
27 |
output = gr.Text()
|
28 |
-
|
29 |
btn = gr.Button("Submit")
|
30 |
-
btn.click(predict, inputs=
|
31 |
|
32 |
-
demo.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
|
2 |
def predict(img):
|
3 |
# Preprocess the input image
|
|
|
9 |
|
10 |
return predicted_digit
|
11 |
|
|
|
12 |
with gr.Blocks() as demo:
|
13 |
gr.Markdown("Welcome on your first sketch recognition app!")
|
14 |
+
|
15 |
with gr.Row():
|
16 |
+
scratchpad = gr.Scratchpad(shape=(28, 28))
|
17 |
output = gr.Text()
|
18 |
+
|
19 |
btn = gr.Button("Submit")
|
20 |
+
btn.click(predict, inputs=scratchpad, outputs=output)
|
21 |
|
22 |
+
demo.launch()
|