Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -6,7 +6,7 @@ from janus.models import VLChatProcessor
|
|
6 |
from PIL import Image
|
7 |
import spaces
|
8 |
|
9 |
-
# Medical
|
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
|
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 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
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)
|