File size: 598 Bytes
bb4ace7
 
 
 
 
 
d450e7f
 
 
 
bb4ace7
 
 
971443b
bb4ace7
50346cc
bb4ace7
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import gradio as gr
from fastai.vision.all import *
learn=load_learner("model.pkl")

def classify_images(im):
    pred,idx,probs=learn.predict(im)
    if pred=='Healthy':
        s='Your plant is '+pred
    else:
        s='Your plant has '+pred
    return s


img=gr.Image(width=300,height=200)

label=gr.Label()
examples=["healthy1.jpeg","mosaic.jpeg","redrot.jpeg"]

intf=gr.Interface(title="Sugarcane leaves Disease Recognition App",description="You can choose an example or choose picture of your plant.",fn=classify_images,inputs=img,outputs=label,examples=examples)
intf.launch(inline=False)