Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,9 +6,9 @@ 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 =
|
| 10 |
-
pred_prob =
|
| 11 |
-
return
|
| 12 |
|
| 13 |
|
| 14 |
iface = gr.Interface(fn=bear_classifier, inputs=gr.inputs.Image(shape=(224, 224)), \
|
|
|
|
| 6 |
|
| 7 |
def bear_classifier(image):
|
| 8 |
pred,pred_idx,probs = learn_inf.predict(image)
|
| 9 |
+
pred_name = 'Prediction: ' + pred
|
| 10 |
+
pred_prob = 'Probability: ' + probs[pred_idx]:.04f
|
| 11 |
+
return pred_name, pred_prob
|
| 12 |
|
| 13 |
|
| 14 |
iface = gr.Interface(fn=bear_classifier, inputs=gr.inputs.Image(shape=(224, 224)), \
|