Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -4,9 +4,9 @@ import gradio as gr
|
|
4 |
|
5 |
#is_black(x) : return x[0].isupper()
|
6 |
categories=('Black people','White people')
|
7 |
-
def func_classi(
|
8 |
learn=load_learner('model.pkl')
|
9 |
-
race,_,probs = learn.predict(PILImage.create(
|
10 |
print(f"This is a: {race}.")
|
11 |
print(f"Probability it's a black person: {probs[0]:.4f}.\nProbability it's a white person: {probs[1]:.4f}")
|
12 |
|
|
|
4 |
|
5 |
#is_black(x) : return x[0].isupper()
|
6 |
categories=('Black people','White people')
|
7 |
+
def func_classi(image):
|
8 |
learn=load_learner('model.pkl')
|
9 |
+
race,_,probs = learn.predict(PILImage.create(image))
|
10 |
print(f"This is a: {race}.")
|
11 |
print(f"Probability it's a black person: {probs[0]:.4f}.\nProbability it's a white person: {probs[1]:.4f}")
|
12 |
|