Spaces:
Sleeping
Sleeping
File size: 475 Bytes
2c7539c ad736da 2c7539c f445876 6a02fbe 2c7539c 03307da d3e5077 4853fee 2c7539c c6c9a02 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
from fastbook import *
import gradio as gr
## lets load the model
learn_inf = load_learner('bear_classifier_cat')
def bear_classifier(image):
pred,pred_idx,probs = learn_inf.predict(image)
pred_name = f"Prediction: {pred}"
pred_prob = f"Probability: {probs[pred_idx]:.04f}"
return pred_name, pred_prob
iface = gr.Interface(fn=bear_classifier, inputs=gr.inputs.Image(shape=(224, 224)), \
outputs=["text", "number"])
iface.launch(inline=False) |