added things
Browse files
app.py
CHANGED
|
@@ -1,7 +1,15 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
-
|
| 4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
-
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
| 7 |
iface.launch()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
+
categories = {'dog', 'cat'}
|
| 4 |
+
|
| 5 |
+
def classify_image(img):
|
| 6 |
+
pred,idx,probs = learn.predict(img)
|
| 7 |
+
return dict(zip(categories,map(float(probs)))
|
| 8 |
+
|
| 9 |
+
image = gr.inputs.Image(shape=(192,192))
|
| 10 |
+
label = gr.outputs.Label()
|
| 11 |
+
examples = ['dog.jpg','cat.jpg','dunno.jpg']
|
| 12 |
+
|
| 13 |
+
intf = gr.Interface(fn=classify_image,inputs=image,outputs=label,examples=examples)
|
| 14 |
|
|
|
|
| 15 |
iface.launch()
|