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