Sefat33 commited on
Commit
aaf71d0
Β·
verified Β·
1 Parent(s): 95b6e18

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -6
app.py CHANGED
@@ -23,7 +23,16 @@ DepthwiseConv2D.from_config = classmethod(
23
 
24
  # --- Constants ---
25
  IMG_SIZE = (224, 224)
26
- CLASS_NAMES = ['Normal', 'Diabetes', 'Glaucoma', 'Cataract', 'AMD', 'Hypertension', 'Myopia', 'Others']
 
 
 
 
 
 
 
 
 
27
  LIME_EXPLAINER = lime_image.LimeImageExplainer()
28
 
29
  # --- Load Model ---
@@ -89,7 +98,7 @@ The model predicted <strong>Normal</strong> because everything looks healthy:<br
89
  - πŸ‘ Disc and macula are well-defined<br>
90
  <span style='color:green'>βœ”οΈ This is a healthy eye.</span>""",
91
 
92
- 'Diabetes': """πŸ’‰ **<span style='color:orange'>Diabetes</span>**<br>
93
  Signs of diabetic eye disease:<br>
94
  - πŸ”Ά Tiny red spots or swelling<br>
95
  - 🩸 Damaged blood vessels<br>
@@ -110,7 +119,7 @@ Blurry image due to lens clouding:<br>
110
  - πŸ” Faded details in retina<br>
111
  <span style='color:gray'>⚠️ Cataract suspected.</span>""",
112
 
113
- 'AMD': """πŸ§“ **<span style='color:red'>AMD</span>**<br>
114
  Macula shows degeneration:<br>
115
  - πŸ”΄ Yellow spots in center<br>
116
  - πŸ‘ Age-related changes<br>
@@ -169,9 +178,6 @@ def show_lime(img, model, pred_idx, pred_label, all_probs):
169
  st.markdown(explanation_text.get(pred_label, "No explanation available."), unsafe_allow_html=True)
170
 
171
 
172
-
173
-
174
-
175
  # --- Streamlit UI ---
176
  st.set_page_config(page_title="πŸ‘ Retina Classifier with LIME", layout="wide")
177
  st.title("πŸ‘ Retina Disease Classifier with LIME + Confidence Chart")
 
23
 
24
  # --- Constants ---
25
  IMG_SIZE = (224, 224)
26
+ CLASS_NAMES = [
27
+ 'Normal',
28
+ 'Diabetic Retinopathy', # Changed from 'Diabetes'
29
+ 'Glaucoma',
30
+ 'Cataract',
31
+ 'Age-related Macular Degeneration (AMD)', # Changed from 'AMD'
32
+ 'Hypertension',
33
+ 'Myopia',
34
+ 'Others'
35
+ ]
36
  LIME_EXPLAINER = lime_image.LimeImageExplainer()
37
 
38
  # --- Load Model ---
 
98
  - πŸ‘ Disc and macula are well-defined<br>
99
  <span style='color:green'>βœ”οΈ This is a healthy eye.</span>""",
100
 
101
+ 'Diabetic Retinopathy': """πŸ’‰ **<span style='color:orange'>Diabetic Retinopathy</span>**<br>
102
  Signs of diabetic eye disease:<br>
103
  - πŸ”Ά Tiny red spots or swelling<br>
104
  - 🩸 Damaged blood vessels<br>
 
119
  - πŸ” Faded details in retina<br>
120
  <span style='color:gray'>⚠️ Cataract suspected.</span>""",
121
 
122
+ 'Age-related Macular Degeneration (AMD)': """πŸ§“ **<span style='color:red'>Age-related Macular Degeneration (AMD)</span>**<br>
123
  Macula shows degeneration:<br>
124
  - πŸ”΄ Yellow spots in center<br>
125
  - πŸ‘ Age-related changes<br>
 
178
  st.markdown(explanation_text.get(pred_label, "No explanation available."), unsafe_allow_html=True)
179
 
180
 
 
 
 
181
  # --- Streamlit UI ---
182
  st.set_page_config(page_title="πŸ‘ Retina Classifier with LIME", layout="wide")
183
  st.title("πŸ‘ Retina Disease Classifier with LIME + Confidence Chart")