Fatser commited on
Commit
dff047b
·
verified ·
1 Parent(s): f458f41

Upload 3 files

Browse files
Files changed (3) hide show
  1. app.py +31 -0
  2. fistik.h5 +3 -0
  3. requirements.txt +2 -0
app.py ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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("fistik.h5")
7
+
8
+ def process_image(img):
9
+ img=img.resize((96,96))
10
+ img=np.array(img)
11
+ img=img/255.0
12
+ img=np.expand_dims(img,axis=0)
13
+ return img
14
+
15
+ st.title("Fistik siniflandirma modeli")
16
+ st.write("Resim sec model hangi Fistik oldugunu tahmin etsin")
17
+
18
+ file=st.file_uploader("Bir resim sec",type=["jpeg","jpg","png"])
19
+
20
+ if file is not None:
21
+ img=Image.open(file)
22
+ st.image(img,caption="yuklenen resim")
23
+ image=process_image(img)
24
+ prediction=model.predict(image)
25
+ predicted_class=np.argmax(prediction)
26
+
27
+ class_names={ 0: 'Kirmizi_Pistachio',
28
+ 1: 'Siirt_Pistachio'
29
+ }
30
+
31
+ st.write(class_names[predicted_class])
fistik.h5 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:20c4888d4d8bac93c45a81e5bd769e30cf4000f127ee38cfa177989984f2451c
3
+ size 48874864
requirements.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ streamlit
2
+ tensorflow