abdullatifkaban commited on
Commit
0feb394
·
verified ·
1 Parent(s): 638130c

Upload 2 files

Browse files
Files changed (2) hide show
  1. app.py +30 -0
  2. requirements.txt +2 -0
app.py ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+
7
+
8
+ model=load_model("my_cnn_model.h5")
9
+
10
+ def process_image(img):
11
+ img=img.resize((170,170))
12
+ img=np.array(img)
13
+ img=img/255.0
14
+ img=np.expand_dims(img, axis=0)
15
+ return img
16
+
17
+ st.title("Kanser Resmi Sınıflandırma :cancer:")
18
+
19
+ st.write("Resim seç ve Model kanser olup olmadığını tahmin etsin")
20
+ file=st.file_uploader("Bir resim seçiniz:", type=["jpg", "jpeg", "png"])
21
+
22
+ if file is not None:
23
+ img = Image.open(file)
24
+ st.image(img, caption="Yüklenen resim")
25
+ image = process_image(img)
26
+ prediction = model.predict(image)
27
+ predicted_class = np.argmax(prediction)
28
+
29
+ class_names = ["Kanser Değil", "Kanser"]
30
+ st.write(class_names[predicted_class])
requirements.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ streamlit
2
+ tensorflow