Spaces:
Sleeping
Sleeping
Upload 4 files
Browse files- app.py +28 -0
- glaucoma_classifier_m_EfficientNetB0.h5 +3 -0
- glaucoma_classifier_m_custom_built.h5 +3 -0
- requirements.txt +3 -0
app.py
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
+
from PIL import Image
|
| 6 |
+
|
| 7 |
+
|
| 8 |
+
model = load_model("glaucoma_classifier_m_EfficientNetB0.h5")
|
| 9 |
+
|
| 10 |
+
st.title("🧠 Glaucoma Detection App")
|
| 11 |
+
st.write("Upload a retinal image to check for signs of glaucoma.")
|
| 12 |
+
|
| 13 |
+
uploaded_file = st.file_uploader("Choose an image...", type=["jpg", "png", "jpeg"])
|
| 14 |
+
|
| 15 |
+
if uploaded_file is not None:
|
| 16 |
+
img = Image.open(uploaded_file)
|
| 17 |
+
st.image(img, caption='Uploaded Image', use_column_width=True)
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
img = img.resize((224, 224))
|
| 21 |
+
img_array = image.img_to_array(img)
|
| 22 |
+
img_array = np.expand_dims(img_array, axis=0) / 255.0
|
| 23 |
+
|
| 24 |
+
prediction = model.predict(img_array)[0][0]
|
| 25 |
+
if prediction >= 0.5:
|
| 26 |
+
st.error("⚠️ Glaucoma Detected")
|
| 27 |
+
else:
|
| 28 |
+
st.success("✅ No Glaucoma Detected")
|
glaucoma_classifier_m_EfficientNetB0.h5
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c59c6367916ea5a8759831cc81d6abca20af4f81dc7bd58c41b8381d776955a6
|
| 3 |
+
size 51169808
|
glaucoma_classifier_m_custom_built.h5
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:81eebdc96578f8cc03fac6e6177dd302a24c2c034117a76931a5436b5a498f9b
|
| 3 |
+
size 134113064
|
requirements.txt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
streamlit
|
| 2 |
+
tensorflow
|
| 3 |
+
Pillow
|