Update Chest_Xray_Report_Generator-V2.py
Browse files
Chest_Xray_Report_Generator-V2.py
CHANGED
@@ -231,6 +231,31 @@ sample_images = [
|
|
231 |
def set_input_image(image_path):
|
232 |
return gr.update(value=image_path)
|
233 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
234 |
|
235 |
with gr.Blocks(css = custom_css) as demo:
|
236 |
|
@@ -299,24 +324,16 @@ with gr.Blocks(css = custom_css) as demo:
|
|
299 |
outputs=feedback_output
|
300 |
)
|
301 |
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
# inputs = gr.File(label="Upload Chest X-ray Image File", type="filepath")
|
308 |
-
# outputs1 =gr.Image(label="Image Viewer")
|
309 |
-
# outputs2 =gr.Image(label="Grad_CAM-Visualization")
|
310 |
-
# outputs3 = gr.Textbox(label="Generated Report")
|
311 |
-
|
312 |
-
|
313 |
-
# interface = gr.Interface(
|
314 |
-
# fn=xray_report_generator,
|
315 |
-
# inputs=inputs,
|
316 |
-
# outputs=[outputs1, outputs2, outputs3],
|
317 |
-
# title="Chest X-ray Report Generator",
|
318 |
-
# description="Upload an X-ray image and get its report.",
|
319 |
-
# )
|
320 |
|
|
|
|
|
321 |
|
322 |
-
#
|
|
|
|
|
|
|
|
|
|
231 |
def set_input_image(image_path):
|
232 |
return gr.update(value=image_path)
|
233 |
|
234 |
+
def show_contact_info():
|
235 |
+
yield gr.update(visible=True, value="""
|
236 |
+
**Contact Us:**
|
237 |
+
- Chayan Mondal
|
238 |
+
- Email: [email protected]
|
239 |
+
- Associate Prof. Sonny Pham
|
240 |
+
- Email: [email protected]
|
241 |
+
- Dr. Ashu Gupta
|
242 |
+
- Email: [email protected]
|
243 |
+
""")
|
244 |
+
# Wait for 20 seconds (you can adjust the time as needed)
|
245 |
+
time.sleep(20)
|
246 |
+
# Hide the content after 5 seconds
|
247 |
+
yield gr.update(visible=False)
|
248 |
+
|
249 |
+
def show_acknowledgment():
|
250 |
+
yield gr.update(visible=True, value="""
|
251 |
+
**Acknowledgment:**
|
252 |
+
This Research has been supported by the Western Australian Future Health Research and Innovation Fund.
|
253 |
+
""")
|
254 |
+
# Wait for 20 seconds
|
255 |
+
time.sleep(20)
|
256 |
+
# Hide the acknowledgment
|
257 |
+
yield gr.update(visible=False)
|
258 |
+
|
259 |
|
260 |
with gr.Blocks(css = custom_css) as demo:
|
261 |
|
|
|
324 |
outputs=feedback_output
|
325 |
)
|
326 |
|
327 |
+
# Buttons and Markdown for Contact Us and Acknowledgment
|
328 |
+
with gr.Row():
|
329 |
+
contact_btn = gr.Button("Contact Us", elem_classes="small-button", variant="secondary")
|
330 |
+
ack_btn = gr.Button("Acknowledgment", elem_classes="small-button", variant="secondary")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
331 |
|
332 |
+
contact_info = gr.Markdown(visible=False) # Initially hidden
|
333 |
+
acknowledgment_info = gr.Markdown(visible=False) # Initially hidden
|
334 |
|
335 |
+
# Update the content and make it visible when the buttons are clicked
|
336 |
+
contact_btn.click(fn=show_contact_info, outputs=contact_info, show_progress=False)
|
337 |
+
ack_btn.click(fn=show_acknowledgment, outputs=acknowledgment_info, show_progress=False)
|
338 |
+
|
339 |
+
demo.launch(share=True)
|