Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,12 +1,11 @@
|
|
1 |
-
|
2 |
-
im.thumbnail((192,192))
|
3 |
learn=load_learner('model.pkl')
|
4 |
-
|
5 |
categories=('white people','black people')
|
6 |
def func_classi(img):
|
7 |
pred,idx,probs=learn.predict(img)
|
8 |
return dict(zip(categories,map(float,probs)))
|
9 |
-
|
10 |
import gradio as gr
|
11 |
image=gr.inputs.Image(shape=(192,192))
|
12 |
label=gr.outputs.Label()
|
|
|
1 |
+
from fastai.vision.all import *
|
|
|
2 |
learn=load_learner('model.pkl')
|
3 |
+
is_black(x) : return x[0].isupper()
|
4 |
categories=('white people','black people')
|
5 |
def func_classi(img):
|
6 |
pred,idx,probs=learn.predict(img)
|
7 |
return dict(zip(categories,map(float,probs)))
|
8 |
+
|
9 |
import gradio as gr
|
10 |
image=gr.inputs.Image(shape=(192,192))
|
11 |
label=gr.outputs.Label()
|