Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,13 +1,12 @@
|
|
| 1 |
from fastbook import *
|
| 2 |
-
import gradio as gr
|
| 3 |
-
|
| 4 |
## lets load the model
|
| 5 |
learn_inf = load_learner('bear_classifier_cat')
|
| 6 |
|
| 7 |
def bear_classifier(image):
|
| 8 |
pred,pred_idx,probs = learn_inf.predict(image)
|
| 9 |
-
pred_name = 'Prediction: '
|
| 10 |
-
pred_prob = 'Probability: '
|
| 11 |
return pred_name, pred_prob
|
| 12 |
|
| 13 |
|
|
|
|
| 1 |
from fastbook import *
|
| 2 |
+
import gradio as gr
|
|
|
|
| 3 |
## lets load the model
|
| 4 |
learn_inf = load_learner('bear_classifier_cat')
|
| 5 |
|
| 6 |
def bear_classifier(image):
|
| 7 |
pred,pred_idx,probs = learn_inf.predict(image)
|
| 8 |
+
pred_name = 'Prediction: ' , pred
|
| 9 |
+
pred_prob = 'Probability: ' , round(probs[pred_idx],4)
|
| 10 |
return pred_name, pred_prob
|
| 11 |
|
| 12 |
|