Spaces:
Runtime error
Runtime error
Commit ·
3a96568
1
Parent(s): cbcd353
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,12 +2,12 @@ import gradio as gr
|
|
| 2 |
import fastai
|
| 3 |
from fastai.vision.all import *
|
| 4 |
learn=load_learner("Gender_classification_with 0.8751480728387833_accuracy.pkl")
|
| 5 |
-
categories=('
|
| 6 |
def classify_image(img):
|
| 7 |
pred,idx,probs=learn.predict(img)
|
| 8 |
return dict(zip(categories,map(float,probs)))
|
| 9 |
image=gr.inputs.Image(shape=(192,192))
|
| 10 |
label=gr.outputs.Label()
|
| 11 |
-
examples=['
|
| 12 |
intf=gr.Interface(fn=classify_image,inputs=image,outputs=label,examples=examples)
|
| 13 |
intf.launch(inline=False)
|
|
|
|
| 2 |
import fastai
|
| 3 |
from fastai.vision.all import *
|
| 4 |
learn=load_learner("Gender_classification_with 0.8751480728387833_accuracy.pkl")
|
| 5 |
+
categories=('female','male')
|
| 6 |
def classify_image(img):
|
| 7 |
pred,idx,probs=learn.predict(img)
|
| 8 |
return dict(zip(categories,map(float,probs)))
|
| 9 |
image=gr.inputs.Image(shape=(192,192))
|
| 10 |
label=gr.outputs.Label()
|
| 11 |
+
examples=['female.jpg','male.jpg']
|
| 12 |
intf=gr.Interface(fn=classify_image,inputs=image,outputs=label,examples=examples)
|
| 13 |
intf.launch(inline=False)
|