Spaces:
Runtime error
Runtime error
Devon Artis
commited on
Commit
·
c90e47e
1
Parent(s):
10d670a
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,16 @@
|
|
1 |
import gradio as gr
|
2 |
|
3 |
-
def greet(name):
|
4 |
-
return "Hello " + name + "!"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
|
6 |
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
7 |
iface.launch()
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
+
#def greet(name):
|
4 |
+
# return "Hello " + name + "!"
|
5 |
+
|
6 |
+
def on_click_classify(change):
|
7 |
+
img = PILImage.create(btn_upload.data[-1])
|
8 |
+
out_pl.clear_output()
|
9 |
+
with out_pl: display(img.to_thumb(128,128))
|
10 |
+
pred,pred_idx,probs = learn_inf.predict(img)
|
11 |
+
lbl_pred.value = f'Prediction: {pred}; Probability: {probs[pred_idx]:.04f}'
|
12 |
+
|
13 |
+
btn_run.on_click(on_click_classify)
|
14 |
|
15 |
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
16 |
iface.launch()
|