Spaces:
Build error
Build error
setting app
Browse files- app.py +17 -0
- healthy1.jpeg +0 -0
- model.pkl +3 -0
- mosaic.jpeg +0 -0
- redrot.jpeg +0 -0
- requirements.txt +1 -0
app.py
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
from fastai.vision.all import *
|
| 3 |
+
learn=load_learner("model.pkl")
|
| 4 |
+
|
| 5 |
+
def classify_images(im):
|
| 6 |
+
pred,idx,probs=learn.predict(im)
|
| 7 |
+
s='Your plant is '+pred
|
| 8 |
+
return s
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
img=gr.inputs.Image()
|
| 13 |
+
label=gr.outputs.Label()
|
| 14 |
+
examples=["healthy1.jpeg","mosaic.jpeg","redrot.jpeg"]
|
| 15 |
+
|
| 16 |
+
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)
|
| 17 |
+
intf.launch(inline=False)
|
healthy1.jpeg
ADDED
|
model.pkl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:55ed30df69007aa568bcf59670c59f04d6e24c3f9552ceefc6f7c66843e59e25
|
| 3 |
+
size 47003865
|
mosaic.jpeg
ADDED
|
redrot.jpeg
ADDED
|
requirements.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
fastai
|