Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -2,7 +2,7 @@ import gradio as gr
|
|
2 |
from fastai.vision.all import *
|
3 |
import skimage
|
4 |
|
5 |
-
learn = load_learner('
|
6 |
|
7 |
labels = learn.dls.vocab
|
8 |
def predict(img):
|
@@ -15,11 +15,11 @@ for root, dirs, files in os.walk(r'sample_images/'):
|
|
15 |
for filename in files:
|
16 |
print(filename)
|
17 |
|
18 |
-
title = "
|
19 |
-
description = "A
|
20 |
interpretation='default'
|
21 |
examples = ["sample_images/"+file for file in files]
|
22 |
-
article="<p style='text-align: center'><a href='https://dicksonneoh.com/' target='_blank'>Blog post</a></p>"
|
23 |
enable_queue=True
|
24 |
|
25 |
gr.Interface(fn=predict,inputs=gr.inputs.Image(shape=(384, 384)),outputs=gr.outputs.Label(num_top_classes=3),title=title,description=description,article=article,examples=examples,interpretation=interpretation,enable_queue=enable_queue, theme="grass").launch()
|
|
|
2 |
from fastai.vision.all import *
|
3 |
import skimage
|
4 |
|
5 |
+
learn = load_learner('export.pkl')
|
6 |
|
7 |
labels = learn.dls.vocab
|
8 |
def predict(img):
|
|
|
15 |
for filename in files:
|
16 |
print(filename)
|
17 |
|
18 |
+
title = "Paddy Disease Classifier with EdgeNeXt"
|
19 |
+
description = "A paddy disease classifier. 9 Diseases + 1 Normal class."
|
20 |
interpretation='default'
|
21 |
examples = ["sample_images/"+file for file in files]
|
22 |
+
article="<p style='text-align: center'><a href='https://dicksonneoh.com/portfolio/pytorch_at_the_edge_timm_torchscript_flutter/' target='_blank'>Blog post</a></p>"
|
23 |
enable_queue=True
|
24 |
|
25 |
gr.Interface(fn=predict,inputs=gr.inputs.Image(shape=(384, 384)),outputs=gr.outputs.Label(num_top_classes=3),title=title,description=description,article=article,examples=examples,interpretation=interpretation,enable_queue=enable_queue, theme="grass").launch()
|