Spaces:
Runtime error
Runtime error
Faisal
commited on
Commit
Β·
c1d8c8a
1
Parent(s):
30d9472
Restore GPU version - remove CPU optimizations and restore GPU-compatible dependencies
Browse files
app.py
CHANGED
|
@@ -39,7 +39,7 @@ temp_generation_config = GenerationConfig(
|
|
| 39 |
# ----------------------------
|
| 40 |
# YOLO MODEL LOADING
|
| 41 |
# ----------------------------
|
| 42 |
-
yolo_model = YOLO("best.pt") # replace with your segmentation weights
|
| 43 |
|
| 44 |
def inference(image_path: str):
|
| 45 |
"""Runs YOLO segmentation on an image and returns the annotated image."""
|
|
@@ -175,7 +175,15 @@ Original Answer:
|
|
| 175 |
# ----------------------------
|
| 176 |
# GRADIO UI
|
| 177 |
# ----------------------------
|
| 178 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 179 |
with gr.Row():
|
| 180 |
# First column: input image and result image side by side
|
| 181 |
with gr.Column():
|
|
@@ -192,7 +200,7 @@ with gr.Blocks(title="Brain MRI QA") as demo:
|
|
| 192 |
clear_btn = gr.Button("Clear")
|
| 193 |
|
| 194 |
# Second column: LLM answer output
|
| 195 |
-
with gr.Column():
|
| 196 |
llm_output = gr.Markdown(label="Detailed LLM Answer")
|
| 197 |
submit_btn.click(
|
| 198 |
fn=process_pipeline,
|
|
|
|
| 39 |
# ----------------------------
|
| 40 |
# YOLO MODEL LOADING
|
| 41 |
# ----------------------------
|
| 42 |
+
yolo_model = YOLO("/kaggle/working/Brain-Tumor-Segmentation/best.pt") # replace with your segmentation weights
|
| 43 |
|
| 44 |
def inference(image_path: str):
|
| 45 |
"""Runs YOLO segmentation on an image and returns the annotated image."""
|
|
|
|
| 175 |
# ----------------------------
|
| 176 |
# GRADIO UI
|
| 177 |
# ----------------------------
|
| 178 |
+
css = """
|
| 179 |
+
.scrollable-column {
|
| 180 |
+
max-height: 80vh;
|
| 181 |
+
overflow-y: auto;
|
| 182 |
+
padding-right: 10px;
|
| 183 |
+
}
|
| 184 |
+
"""
|
| 185 |
+
|
| 186 |
+
with gr.Blocks(title="Brain MRI QA", css=css) as demo:
|
| 187 |
with gr.Row():
|
| 188 |
# First column: input image and result image side by side
|
| 189 |
with gr.Column():
|
|
|
|
| 200 |
clear_btn = gr.Button("Clear")
|
| 201 |
|
| 202 |
# Second column: LLM answer output
|
| 203 |
+
with gr.Column(elem_classes="scrollable-column"):
|
| 204 |
llm_output = gr.Markdown(label="Detailed LLM Answer")
|
| 205 |
submit_btn.click(
|
| 206 |
fn=process_pipeline,
|