woffluon commited on
Commit
b427d16
·
verified ·
1 Parent(s): 3ba58fb

Update ui/dashboard.py

Browse files
Files changed (1) hide show
  1. ui/dashboard.py +19 -7
ui/dashboard.py CHANGED
@@ -31,8 +31,14 @@ def render_css():
31
  img {
32
  border-radius: 10px;
33
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
34
- image-rendering: -webkit-optimize-contrast;
35
- image-rendering: crisp-edges;
 
 
 
 
 
 
36
  }
37
 
38
  .report-box {
@@ -55,6 +61,12 @@ def render_css():
55
  font-size: 0.95rem !important;
56
  }
57
  </style>
 
 
 
 
 
 
58
  """, unsafe_allow_html=True)
59
 
60
  def render_header(app_name, version):
@@ -99,11 +111,11 @@ def render_classification_panel(img_rgb, diagnosis, cls_conf, seg_conf, gradcam_
99
  st.warning("Düşük güven skoru. Lütfen manuel inceleme yapınız.")
100
 
101
  with col_orig:
102
- st.image(img_rgb, caption="Orijinal Görüntü", width="stretch")
103
 
104
  with col_xai:
105
  overlay = apply_heatmap_overlay(img_rgb, gradcam_map, alpha=0.5)
106
- st.image(overlay, caption="Yapay Zeka Odak Alanları (Grad-CAM)", width="stretch")
107
 
108
  def render_segmentation_panel(img_rgb, nuc_map, uncertainty_map, instance_mask, stats):
109
  st.markdown("---")
@@ -120,12 +132,12 @@ def render_segmentation_panel(img_rgb, nuc_map, uncertainty_map, instance_mask,
120
  c1, c2 = st.columns(2)
121
  with c1:
122
  nuc_colored = apply_heatmap_overlay(img_rgb, nuc_map, colormap=cv2.COLORMAP_OCEAN, alpha=0.6)
123
- st.image(nuc_colored, caption="Nükleus Olasılık Haritası (AI Çıktısı)", width="stretch")
124
  with c2:
125
  mask_rgb = np.zeros_like(img_rgb)
126
  mask_rgb[instance_mask > 0] = [0, 255, 0] # Green
127
  overlay = cv2.addWeighted(img_rgb, 0.7, mask_rgb, 0.3, 0)
128
- st.image(overlay, caption="Ayrıştırılmış Hücreler (Watershed)", width="stretch")
129
 
130
  with tab_unc:
131
  c1, c2 = st.columns([1, 2])
@@ -139,7 +151,7 @@ def render_segmentation_panel(img_rgb, nuc_map, uncertainty_map, instance_mask,
139
  """)
140
  with c2:
141
  unc_colored = apply_heatmap_overlay(img_rgb, uncertainty_map, colormap=cv2.COLORMAP_INFERNO, alpha=0.7)
142
- st.image(unc_colored, caption="Model Entropi (Belirsizlik) Haritası", width="stretch")
143
 
144
  with tab_data:
145
  if not stats.empty:
 
31
  img {
32
  border-radius: 10px;
33
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
34
+ width: 100%;
35
+ height: auto;
36
+ display: block;
37
+ image-rendering: auto;
38
+ }
39
+ .stImage > div {
40
+ width: 100%;
41
+ max-width: 100%;
42
  }
43
 
44
  .report-box {
 
61
  font-size: 0.95rem !important;
62
  }
63
  </style>
64
+ <script>
65
+ const meta = window.parent?.document?.querySelector('meta[http-equiv="Permissions-Policy"]');
66
+ if (meta) {
67
+ meta.setAttribute('content', 'geolocation=(), microphone=()');
68
+ }
69
+ </script>
70
  """, unsafe_allow_html=True)
71
 
72
  def render_header(app_name, version):
 
111
  st.warning("Düşük güven skoru. Lütfen manuel inceleme yapınız.")
112
 
113
  with col_orig:
114
+ st.image(img_rgb, caption="Orijinal Görüntü", use_column_width=True)
115
 
116
  with col_xai:
117
  overlay = apply_heatmap_overlay(img_rgb, gradcam_map, alpha=0.5)
118
+ st.image(overlay, caption="Yapay Zeka Odak Alanları (Grad-CAM)", use_column_width=True)
119
 
120
  def render_segmentation_panel(img_rgb, nuc_map, uncertainty_map, instance_mask, stats):
121
  st.markdown("---")
 
132
  c1, c2 = st.columns(2)
133
  with c1:
134
  nuc_colored = apply_heatmap_overlay(img_rgb, nuc_map, colormap=cv2.COLORMAP_OCEAN, alpha=0.6)
135
+ st.image(nuc_colored, caption="Nükleus Olasılık Haritası (AI Çıktısı)", use_column_width=True)
136
  with c2:
137
  mask_rgb = np.zeros_like(img_rgb)
138
  mask_rgb[instance_mask > 0] = [0, 255, 0] # Green
139
  overlay = cv2.addWeighted(img_rgb, 0.7, mask_rgb, 0.3, 0)
140
+ st.image(overlay, caption="Ayrıştırılmış Hücreler (Watershed)", use_column_width=True)
141
 
142
  with tab_unc:
143
  c1, c2 = st.columns([1, 2])
 
151
  """)
152
  with c2:
153
  unc_colored = apply_heatmap_overlay(img_rgb, uncertainty_map, colormap=cv2.COLORMAP_INFERNO, alpha=0.7)
154
+ st.image(unc_colored, caption="Model Entropi (Belirsizlik) Haritası", use_column_width=True)
155
 
156
  with tab_data:
157
  if not stats.empty: