elifsara commited on
Commit
809d12d
·
verified ·
1 Parent(s): bf94d61

Upload 3 files

Browse files
Files changed (3) hide show
  1. app.py +28 -0
  2. potato_leaf_disease.h5 +3 -0
  3. requirements.txt +2 -0
app.py ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ from tensorflow.keras.models import load_model
3
+ from PIL import Image
4
+ import numpy as np
5
+
6
+ model=load_model('potato_leaf_disease.h5', compile=False)
7
+
8
+ def process_image(img):
9
+ img=img.resize((170,170)) #boyutunu 170*170 pixel yaptık
10
+ img=np.array(img)
11
+ img=img/255.0 #Normalize ettik
12
+ img=np.expand_dims(img,axis=0)
13
+ return img
14
+
15
+ st.title('Potato Leaf Disease Classification:potato:')
16
+ st.write('Pick an image and It will predict the disease')
17
+
18
+ file=st.file_uploader('Upload an image', type=['jpg','jpeg','png'])
19
+
20
+ if file is not None:
21
+ img=Image.open(file)
22
+ st.image(img,caption='Uploaded image')
23
+ image=process_image(img)
24
+ prediction=model.predict(image)
25
+ predicted_class=np.argmax(prediction)
26
+
27
+ class_names=['Early_Blight','Healthy','Late_Blight']
28
+ st.write(class_names[predicted_class])
potato_leaf_disease.h5 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f1967bd4b9aa031170d6440d8bfad7564a24a3da1b6e37bbe4f71a163772b0e7
3
+ size 165527408
requirements.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ streamlit
2
+ tensorflow