moro23 commited on
Commit
4853fee
·
1 Parent(s): d40eb6d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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 = f'Prediction: {pred}'
10
- pred_prob = f'Probability: {probs[pred_idx]:.04f}'
11
- return image, pred_name, pred_prob
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)), \