Spaces:
Runtime error
Runtime error
Commit
·
10fd9e8
1
Parent(s):
764a96c
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,9 @@
|
|
1 |
from fastai.vision.all import *
|
2 |
import gradio as gr
|
3 |
import pickle
|
|
|
|
|
|
|
4 |
|
5 |
learn=load_learner('model.pkl')
|
6 |
categories=('man','woman')
|
@@ -9,7 +12,7 @@ def classify(img):
|
|
9 |
return dict(zip(categories,map(float,prob)))
|
10 |
image=gr.inputs.Image(shape=(192,192))
|
11 |
label=gr.outputs.label()
|
12 |
-
examples = ["
|
13 |
intf = gr.Interface(fn=classify, inputs=image,
|
14 |
outputs=label, examples=examples, title="Man or Woman !!!")
|
15 |
intf.launch(inline=False)
|
|
|
1 |
from fastai.vision.all import *
|
2 |
import gradio as gr
|
3 |
import pickle
|
4 |
+
import pathlib
|
5 |
+
temp = pathlib.PosixPath
|
6 |
+
pathlib.PosixPath = pathlib.WindowsPath
|
7 |
|
8 |
learn=load_learner('model.pkl')
|
9 |
categories=('man','woman')
|
|
|
12 |
return dict(zip(categories,map(float,prob)))
|
13 |
image=gr.inputs.Image(shape=(192,192))
|
14 |
label=gr.outputs.label()
|
15 |
+
examples = ["man.jpg", "woman.jpg"]
|
16 |
intf = gr.Interface(fn=classify, inputs=image,
|
17 |
outputs=label, examples=examples, title="Man or Woman !!!")
|
18 |
intf.launch(inline=False)
|