File size: 592 Bytes
2018330
 
 
88a2e5f
 
429c768
 
 
 
 
2018330
 
 
 
3e3e817
1137a04
 
2018330
 
d84bb39
1137a04
2018330
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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_bear_classifier_v1.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)