Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -31,7 +31,7 @@ condition_details = {
|
|
| 31 |
"Aortic Aneurysm": {"description": "Abnormal enlargement of the aorta.", "recommendation": "Vascular surgery evaluation."},
|
| 32 |
"Stroke": {"description": "Signs of brain ischemia or hemorrhage.", "recommendation": "Urgent neurological evaluation."},
|
| 33 |
"Peripheral Artery Disease": {"description": "Reduced blood flow in peripheral arteries.", "recommendation": "Vascular specialist consultation."},
|
| 34 |
-
"Brain Tumor"
|
| 35 |
"Alzheimer's Disease": {"description": "Signs of neurodegenerative changes.", "recommendation": "Neurology consultation."},
|
| 36 |
"Multiple Sclerosis": {"description": "Demyelinating lesions in the CNS.", "recommendation": "Neurology consultation."},
|
| 37 |
"Epilepsy": {"description": "Signs of seizure activity.", "recommendation": "Neurology consultation."},
|
|
@@ -164,9 +164,14 @@ def analyze_report(file):
|
|
| 164 |
# Gradio Interface with Tabs
|
| 165 |
def create_interface():
|
| 166 |
logger.debug("Initializing Gradio interface")
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 170 |
|
| 171 |
with gr.Tabs():
|
| 172 |
with gr.TabItem("X-ray Analysis"):
|
|
@@ -193,6 +198,9 @@ def create_interface():
|
|
| 193 |
|
| 194 |
if __name__ == "__main__":
|
| 195 |
logger.debug("Starting Gradio application")
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
"Aortic Aneurysm": {"description": "Abnormal enlargement of the aorta.", "recommendation": "Vascular surgery evaluation."},
|
| 32 |
"Stroke": {"description": "Signs of brain ischemia or hemorrhage.", "recommendation": "Urgent neurological evaluation."},
|
| 33 |
"Peripheral Artery Disease": {"description": "Reduced blood flow in peripheral arteries.", "recommendation": "Vascular specialist consultation."},
|
| 34 |
+
"Brain Tumor": {"description": "Abnormal mass in the brain detected.", "recommendation": "Consult a neurosurgeon."},
|
| 35 |
"Alzheimer's Disease": {"description": "Signs of neurodegenerative changes.", "recommendation": "Neurology consultation."},
|
| 36 |
"Multiple Sclerosis": {"description": "Demyelinating lesions in the CNS.", "recommendation": "Neurology consultation."},
|
| 37 |
"Epilepsy": {"description": "Signs of seizure activity.", "recommendation": "Neurology consultation."},
|
|
|
|
| 164 |
# Gradio Interface with Tabs
|
| 165 |
def create_interface():
|
| 166 |
logger.debug("Initializing Gradio interface")
|
| 167 |
+
# Minimal CSS to avoid styling issues
|
| 168 |
+
custom_css = """
|
| 169 |
+
.title { font-size: 30px; text-align: center; color: #4C6A92; }
|
| 170 |
+
.subtitle { text-align: center; color: #666; }
|
| 171 |
+
"""
|
| 172 |
+
with gr.Blocks(css=custom_css) as demo:
|
| 173 |
+
gr.Markdown("<h1 class='title'>RadiologyScan AI</h1>")
|
| 174 |
+
gr.Markdown("<p class='subtitle'>AI-powered analysis for X-rays and patient reports</p>")
|
| 175 |
|
| 176 |
with gr.Tabs():
|
| 177 |
with gr.TabItem("X-ray Analysis"):
|
|
|
|
| 198 |
|
| 199 |
if __name__ == "__main__":
|
| 200 |
logger.debug("Starting Gradio application")
|
| 201 |
+
try:
|
| 202 |
+
demo = create_interface()
|
| 203 |
+
demo.launch(server_port=7860, ssr_mode=False) # Explicit port, disable SSR
|
| 204 |
+
logger.debug("Gradio application launched")
|
| 205 |
+
except Exception as e:
|
| 206 |
+
logger.error(f"Failed to launch Gradio application: {str(e)}")
|