File size: 857 Bytes
5e826a5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import gradio as gr
from fastai.vision.all import *
from glob import glob

learn_inf = load_learner('model.pkl')

categories = ("Decease", "Healthy")

def classify(img):
    pred, pred_idx, probs = learn_inf.predict(img)
    return dict(zip(categories, map(float, probs)))

image = gr.inputs.Image(shape=(224, 224))
label = gr.outputs.Label()
examples = glob("images/*.jpg")

title = "Strawberry Leaves Decease Classifier"
description = "This classifier was trained on the 'Image Dataset for Tipburn Disorder Detection in Strawberry Leaves' and it is designed to help you detect weather straberry leaves are infected or not."
interpretation='default'

iface = gr.Interface(fn=classify, inputs=image, outputs=label, examples=examples, 
                     title=title, description=description, interpretation=interpretation)
iface.launch(enable_queue=True)