Update app.py
Browse files
app.py
CHANGED
|
@@ -34,14 +34,23 @@ def recognize_digit(image):
|
|
| 34 |
image = image.reshape(1, -1) # add a batch dimension
|
| 35 |
prediction = model.predict(image).tolist()[0]
|
| 36 |
return {str(i): prediction[i] for i in range(10)}
|
|
|
|
|
|
|
|
|
|
| 37 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
demo = gr.Interface(fn=recognize_digit,
|
| 39 |
inputs="sketchpad",
|
| 40 |
outputs=gr.outputs.Label(num_top_classes=3),
|
| 41 |
live=True,
|
| 42 |
css=".footer {display:none !important}",
|
| 43 |
-
title=
|
| 44 |
-
description=
|
| 45 |
thumbnail="https://raw.githubusercontent.com/gradio-app/real-time-mnist/master/thumbnail2.png")
|
| 46 |
|
| 47 |
demo.launch()
|
|
|
|
| 34 |
image = image.reshape(1, -1) # add a batch dimension
|
| 35 |
prediction = model.predict(image).tolist()[0]
|
| 36 |
return {str(i): prediction[i] for i in range(10)}
|
| 37 |
+
|
| 38 |
+
TITLE="Recoully: RECOgnize yoUr caLLigraphY"
|
| 39 |
+
description="""在手写区写出你心里想的以为数字(0~9), 查看小美同学的实时预测吧!
|
| 40 |
|
| 41 |
+
### 项目介绍
|
| 42 |
+
- 中文名: 小美同学
|
| 43 |
+
- 英文名: Recoully
|
| 44 |
+
- 口头禅: 小美这么可爱, 就算猜错了也希望被原谅~~qaq
|
| 45 |
+
|
| 46 |
+
"""
|
| 47 |
demo = gr.Interface(fn=recognize_digit,
|
| 48 |
inputs="sketchpad",
|
| 49 |
outputs=gr.outputs.Label(num_top_classes=3),
|
| 50 |
live=True,
|
| 51 |
css=".footer {display:none !important}",
|
| 52 |
+
title=TITLE,
|
| 53 |
+
description=,
|
| 54 |
thumbnail="https://raw.githubusercontent.com/gradio-app/real-time-mnist/master/thumbnail2.png")
|
| 55 |
|
| 56 |
demo.launch()
|