Spaces:
No application file
No application file
Upload 3 files
Browse files- app.py.py +31 -0
- requirements.txt.txt +4 -0
- skin_cancer_model_v1.h5 +3 -0
app.py.py
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
from tensorflow.keras.models import load_model
|
| 3 |
+
from tensorflow.keras.preprocessing import image
|
| 4 |
+
import numpy as np
|
| 5 |
+
|
| 6 |
+
st.title("Skin Cancer Detection AI Agent")
|
| 7 |
+
uploaded_file = st.file_uploader("Upload a skin lesion image", type=["jpg", "png"])
|
| 8 |
+
|
| 9 |
+
if uploaded_file:
|
| 10 |
+
model = load_model('skin_cancer_model_v1.h5')
|
| 11 |
+
img = image.load_img(uploaded_file, target_size=(224, 224))
|
| 12 |
+
img_array = image.img_to_array(img) / 255.0
|
| 13 |
+
img_array = np.expand_dims(img_array, axis=0)
|
| 14 |
+
|
| 15 |
+
prediction = model.predict(img_array)
|
| 16 |
+
st.write(f"Predicted Class: {np.argmax(prediction)}")import streamlit as st
|
| 17 |
+
from tensorflow.keras.models import load_model
|
| 18 |
+
from tensorflow.keras.preprocessing import image
|
| 19 |
+
import numpy as np
|
| 20 |
+
|
| 21 |
+
st.title("Skin Cancer Detection AI Agent")
|
| 22 |
+
uploaded_file = st.file_uploader("Upload a skin lesion image", type=["jpg", "png"])
|
| 23 |
+
|
| 24 |
+
if uploaded_file:
|
| 25 |
+
model = load_model('skin_cancer_model_v1.h5')
|
| 26 |
+
img = image.load_img(uploaded_file, target_size=(224, 224))
|
| 27 |
+
img_array = image.img_to_array(img) / 255.0
|
| 28 |
+
img_array = np.expand_dims(img_array, axis=0)
|
| 29 |
+
|
| 30 |
+
prediction = model.predict(img_array)
|
| 31 |
+
st.write(f"Predicted Class: {np.argmax(prediction)}")
|
requirements.txt.txt
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
tensorflow
|
| 2 |
+
streamlit
|
| 3 |
+
numpy
|
| 4 |
+
pillow
|
skin_cancer_model_v1.h5
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f8aff69536bd77a692c594f559c798c19bf7f3f36668fc9fa00b21c6aab4797c
|
| 3 |
+
size 9406464
|