Enhance sketch recognition app: add image to app description and update sketchpad input parameters
Browse files
app.py
CHANGED
@@ -10,6 +10,7 @@ title = "Welcome to your first sketch recognition app!"
|
|
10 |
# app description
|
11 |
head = (
|
12 |
"<center>"
|
|
|
13 |
"The robot was trained to classify numbers (from 0 to 9). To test it, write your number in the space provided."
|
14 |
"</center>"
|
15 |
)
|
@@ -56,7 +57,7 @@ label = gr.Label(num_top_classes=3)
|
|
56 |
# open Gradio interface for sketch recognition
|
57 |
interface = gr.Interface(
|
58 |
fn=predict,
|
59 |
-
inputs=gr.Sketchpad(
|
60 |
outputs=label,
|
61 |
title=title,
|
62 |
description=head,
|
|
|
10 |
# app description
|
11 |
head = (
|
12 |
"<center>"
|
13 |
+
"<img src='mnist-classes.png' width=400><br>"
|
14 |
"The robot was trained to classify numbers (from 0 to 9). To test it, write your number in the space provided."
|
15 |
"</center>"
|
16 |
)
|
|
|
57 |
# open Gradio interface for sketch recognition
|
58 |
interface = gr.Interface(
|
59 |
fn=predict,
|
60 |
+
inputs=gr.Sketchpad(height=280, width=280), # Changed from shape to height and width
|
61 |
outputs=label,
|
62 |
title=title,
|
63 |
description=head,
|