Update model path in app.py to use a relative directory and simplify Gradio interface launch
Browse files
app.py
CHANGED
@@ -26,7 +26,7 @@ img_size = 28
|
|
26 |
labels = ["zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"]
|
27 |
|
28 |
# load model (trained on MNIST dataset)
|
29 |
-
model = tf.keras.models.load_model("
|
30 |
|
31 |
# prediction function for sketch recognition
|
32 |
def predict(img):
|
@@ -40,4 +40,4 @@ label = gr.Label(num_top_classes=3)
|
|
40 |
|
41 |
# open Gradio interface for sketch recognition
|
42 |
interface = gr.Interface(fn=predict, inputs="sketchpad", outputs=label, title=title, description=head, article=ref)
|
43 |
-
interface.launch(
|
|
|
26 |
labels = ["zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"]
|
27 |
|
28 |
# load model (trained on MNIST dataset)
|
29 |
+
model = tf.keras.models.load_model("model/sketch_recognition_numbers_model.h5")
|
30 |
|
31 |
# prediction function for sketch recognition
|
32 |
def predict(img):
|
|
|
40 |
|
41 |
# open Gradio interface for sketch recognition
|
42 |
interface = gr.Interface(fn=predict, inputs="sketchpad", outputs=label, title=title, description=head, article=ref)
|
43 |
+
interface.launch()
|