ALYYAN commited on
Commit
22352ad
·
unverified ·
1 Parent(s): 2808465

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -5
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("You can download these sample images to test the tool 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
- for img_path in NORMAL_SAMPLES:
109
- gr.File(value=img_path, label=Path(img_path).name, interactive=False)
 
 
 
 
 
 
110
 
111
  with gr.Column():
112
  gr.Markdown("### Pneumonia Cases")
113
- for img_path in PNEUMONIA_SAMPLES:
114
- gr.File(value=img_path, label=Path(img_path).name, interactive=False)
 
 
 
 
 
 
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)