Spaces:
Sleeping
Sleeping
adds title and description
Browse files
app.py
CHANGED
@@ -6,6 +6,9 @@ with open('model_91_7248.bin', 'rb') as f:
|
|
6 |
|
7 |
|
8 |
def predict(input):
|
|
|
|
|
|
|
9 |
x = input.reshape((784, 1))
|
10 |
p = nn.feed_forward(x).reshape((10,))
|
11 |
|
@@ -14,6 +17,8 @@ def predict(input):
|
|
14 |
|
15 |
demo = gr.Interface(
|
16 |
fn=predict,
|
|
|
|
|
17 |
inputs=[
|
18 |
gr.Sketchpad(
|
19 |
shape=(28, 28),
|
@@ -23,10 +28,9 @@ demo = gr.Interface(
|
|
23 |
outputs=[
|
24 |
gr.Label(
|
25 |
num_top_classes=3,
|
26 |
-
scale=
|
27 |
)
|
28 |
],
|
29 |
live=True,
|
30 |
allow_flagging=False,
|
31 |
-
|
32 |
).launch()
|
|
|
6 |
|
7 |
|
8 |
def predict(input):
|
9 |
+
if input is None:
|
10 |
+
return 'None'
|
11 |
+
|
12 |
x = input.reshape((784, 1))
|
13 |
p = nn.feed_forward(x).reshape((10,))
|
14 |
|
|
|
17 |
|
18 |
demo = gr.Interface(
|
19 |
fn=predict,
|
20 |
+
title='Simple NeuralNet for handwritten digits classification',
|
21 |
+
description='For a more robust model check this out: <a href="https://huggingface.co/spaces/ffcm/cnn-pytorch-mnist">ConvNet for handwritten digits classification</a>',
|
22 |
inputs=[
|
23 |
gr.Sketchpad(
|
24 |
shape=(28, 28),
|
|
|
28 |
outputs=[
|
29 |
gr.Label(
|
30 |
num_top_classes=3,
|
31 |
+
scale=3,
|
32 |
)
|
33 |
],
|
34 |
live=True,
|
35 |
allow_flagging=False,
|
|
|
36 |
).launch()
|