Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -7,9 +7,7 @@ model = load_model("MNIST_model.keras")
|
|
| 7 |
def MNIST(arr):
|
| 8 |
arr = arr.reshape((1,28,28,1))
|
| 9 |
output = model(arr)
|
| 10 |
-
|
| 11 |
-
probs_list.sort(reverse=True)
|
| 12 |
-
return "\n".join([str(idx) + ": " + str(round((val * 100), 2)) + "% sure" for (val, idx) in probs_list])
|
| 13 |
|
| 14 |
-
iface = gr.Interface(fn=MNIST, inputs="sketchpad", outputs="
|
| 15 |
iface.launch()
|
|
|
|
| 7 |
def MNIST(arr):
|
| 8 |
arr = arr.reshape((1,28,28,1))
|
| 9 |
output = model(arr)
|
| 10 |
+
return {idx: float(val) for idx, val in enumerate(output[0])}
|
|
|
|
|
|
|
| 11 |
|
| 12 |
+
iface = gr.Interface(fn=MNIST, inputs="sketchpad", outputs="label")
|
| 13 |
iface.launch()
|