Spaces:
Runtime error
Runtime error
app.py
Browse files
app.py
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
categories=('white people','black people')
|
2 |
+
def func_classi(img):
|
3 |
+
pred,idx,probs=learn.predict(img)
|
4 |
+
return dict(zip(categories,map(float,probs)))
|
5 |
+
|
6 |
+
import gradio as gr
|
7 |
+
image=gr.inputs.Image(shape=(192,192))
|
8 |
+
label=gr.outputs.Label()
|
9 |
+
examples=('white people','black people')
|
10 |
+
demo = gr.Interface(fn=func_classi, inputs="image", outputs="label")
|
11 |
+
demo.launch(inline=False,share=True)
|