Spaces:
Sleeping
Sleeping
Upload 3 files
Browse files- app.py +30 -0
- requierements.txt +2 -0
- skin_canser_cnn_model.h5 +3 -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 |
+
model = load_model('skin_canser_cnn_model.h5')
|
7 |
+
|
8 |
+
|
9 |
+
def process_image(img):
|
10 |
+
img= img.resize((170,170))
|
11 |
+
img = np.array(img)
|
12 |
+
img = img/255.0 # normalize
|
13 |
+
img = np.expand_dims(img,axis=0)
|
14 |
+
return img
|
15 |
+
|
16 |
+
|
17 |
+
st.title('Skin Canser Classification :cancer:')
|
18 |
+
st.write('Upload Test Image')
|
19 |
+
|
20 |
+
|
21 |
+
file = st.file_uploader('Enter Image', type=['jpg','png','jpeg'])
|
22 |
+
|
23 |
+
if file is not None:
|
24 |
+
img=Image.open(file)
|
25 |
+
st.image(img,caption='Uploaded Image')
|
26 |
+
image = process_image(img)
|
27 |
+
prediction = model.predict(image)
|
28 |
+
predicted_class = np.argmax(prediction)
|
29 |
+
class_names = ['Canser !','Not Canser !']
|
30 |
+
st.write(class_names[predicted_class])
|
requierements.txt
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
streamlit
|
2 |
+
tensorflow
|
skin_canser_cnn_model.h5
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:07f747e3ead8331022f9bf06a9b52771d1fe22be08c86086b886c8403a53e7f9
|
3 |
+
size 165525616
|