Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -99,19 +99,31 @@ with gr.Blocks(theme=gr.themes.Default(primary_hue="blue", secondary_hue="blue")
|
|
| 99 |
|
| 100 |
with gr.Column(visible=False) as samples_page:
|
| 101 |
gr.Markdown("# 🖼️ Sample Image Library", elem_classes="app_title")
|
| 102 |
-
gr.Markdown("
|
| 103 |
back_to_main_btn_samp = gr.Button("⬅️ Back to Main App")
|
| 104 |
|
| 105 |
with gr.Row():
|
| 106 |
with gr.Column():
|
| 107 |
gr.Markdown("### Normal Cases")
|
| 108 |
-
|
| 109 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 110 |
|
| 111 |
with gr.Column():
|
| 112 |
gr.Markdown("### Pneumonia Cases")
|
| 113 |
-
for
|
| 114 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 115 |
|
| 116 |
# --- Event Handling Logic (Unchanged and Correct) ---
|
| 117 |
def show_patient_info(files): return gr.update(visible=True) if files else gr.update(visible=False)
|
|
|
|
| 99 |
|
| 100 |
with gr.Column(visible=False) as samples_page:
|
| 101 |
gr.Markdown("# 🖼️ Sample Image Library", elem_classes="app_title")
|
| 102 |
+
gr.Markdown("Right-click on any image and select **'Save Image As...'** to download it for testing on the main page.")
|
| 103 |
back_to_main_btn_samp = gr.Button("⬅️ Back to Main App")
|
| 104 |
|
| 105 |
with gr.Row():
|
| 106 |
with gr.Column():
|
| 107 |
gr.Markdown("### Normal Cases")
|
| 108 |
+
# Use a Gallery to display the images visually
|
| 109 |
+
gr.Gallery(
|
| 110 |
+
value=NORMAL_SAMPLES,
|
| 111 |
+
label="Normal X-Rays",
|
| 112 |
+
columns=5,
|
| 113 |
+
object_fit="contain",
|
| 114 |
+
height="auto"
|
| 115 |
+
)
|
| 116 |
|
| 117 |
with gr.Column():
|
| 118 |
gr.Markdown("### Pneumonia Cases")
|
| 119 |
+
# Use a Gallery for the pneumonia samples as well
|
| 120 |
+
gr.Gallery(
|
| 121 |
+
value=PNEUMONIA_SAMPLES,
|
| 122 |
+
label="Pneumonia X-Rays",
|
| 123 |
+
columns=5,
|
| 124 |
+
object_fit="contain",
|
| 125 |
+
height="auto"
|
| 126 |
+
)
|
| 127 |
|
| 128 |
# --- Event Handling Logic (Unchanged and Correct) ---
|
| 129 |
def show_patient_info(files): return gr.update(visible=True) if files else gr.update(visible=False)
|