mgbam commited on
Commit
aa563db
·
verified ·
1 Parent(s): 3afe8c3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -8
app.py CHANGED
@@ -6,7 +6,7 @@ from janus.models import VLChatProcessor
6
  from PIL import Image
7
  import spaces
8
 
9
- # Medical Image Analysis Configuration
10
  MEDICAL_CONFIG = {
11
  "echo_guidelines": "ASE 2023 Standards",
12
  "histo_guidelines": "CAP Protocols 2024",
@@ -135,7 +135,7 @@ with gr.Blocks(title="Cardiac & Histopathology AI", theme=gr.themes.Soft()) as d
135
  with gr.Column():
136
  report_output = gr.Markdown(label="AI Clinical Report")
137
 
138
- # Preloaded examples from space files
139
  gr.Examples(
140
  examples=[
141
  ["Evaluate LV systolic function", "case1.png", "Echo"],
@@ -147,10 +147,11 @@ with gr.Blocks(title="Cardiac & Histopathology AI", theme=gr.themes.Soft()) as d
147
  label="Example Medical Cases"
148
  )
149
 
150
- analyze_btn.click(
151
- analyze_medical_case,
152
- [image_input, clinical_input, modality_select],
153
- report_output
154
- )
 
155
 
156
- demo.launch(share=True)
 
6
  from PIL import Image
7
  import spaces
8
 
9
+ # Medical Imaging Analysis Configuration
10
  MEDICAL_CONFIG = {
11
  "echo_guidelines": "ASE 2023 Standards",
12
  "histo_guidelines": "CAP Protocols 2024",
 
135
  with gr.Column():
136
  report_output = gr.Markdown(label="AI Clinical Report")
137
 
138
+ # Preloaded examples
139
  gr.Examples(
140
  examples=[
141
  ["Evaluate LV systolic function", "case1.png", "Echo"],
 
147
  label="Example Medical Cases"
148
  )
149
 
150
+ @demo.func
151
+ def analyze_and_display(image, clinical_context, modality):
152
+ report = analyze_medical_case(image, clinical_context, modality)
153
+ return report
154
+
155
+ analyze_btn.click(analyze_and_display, [image_input, clinical_input, modality_select], report_output)
156
 
157
+ demo.launch(share=True)