Spaces:
Runtime error
Runtime error
from fastbook import * | |
import gradio as gr | |
def get_y(o): | |
return [parent_label(o)] | |
## lets load the model | |
learn_inf = load_learner('multi_label_maize_disease_classifier.pkl') | |
def maize_disease_classifier(image): | |
pred,pred_idx,probs = learn_inf.predict(image) | |
pred_name = f"Prediction: {pred}" | |
pred_prob = f"Probability: {probs[pred_idx]}" | |
pred_array = pred_idx | |
return pred_name, pred_prob, pred_array | |
iface = gr.Interface(fn=maize_disease_classifier, inputs=gr.inputs.Image(shape=(224, 224)), \ | |
outputs=["text", "number", "text"]) | |
iface.launch(inline=False) |