Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -278,6 +278,23 @@ with gr.Blocks(title="Surgical-DeSAM", theme=gr.themes.Soft()) as demo:
|
|
| 278 |
gr.Markdown("Segment surgical instruments in images or videos using DeSAM architecture.")
|
| 279 |
|
| 280 |
with gr.Tabs():
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 281 |
# Image Tab
|
| 282 |
with gr.TabItem("🖼️ Image Segmentation"):
|
| 283 |
with gr.Row():
|
|
@@ -299,22 +316,7 @@ with gr.Blocks(title="Surgical-DeSAM", theme=gr.themes.Soft()) as demo:
|
|
| 299 |
label="Example Surgical Images"
|
| 300 |
)
|
| 301 |
|
| 302 |
-
|
| 303 |
-
with gr.TabItem("🎬 Video Segmentation"):
|
| 304 |
-
with gr.Row():
|
| 305 |
-
with gr.Column():
|
| 306 |
-
input_video = gr.Video(label="Input Video")
|
| 307 |
-
video_btn = gr.Button("Segment Video", variant="primary")
|
| 308 |
-
with gr.Column():
|
| 309 |
-
output_video = gr.Video(label="Segmentation Result")
|
| 310 |
-
|
| 311 |
-
video_btn.click(fn=predict_video, inputs=input_video, outputs=output_video)
|
| 312 |
-
|
| 313 |
-
gr.Examples(
|
| 314 |
-
examples=["examples/surgical_demo.mp4"],
|
| 315 |
-
inputs=input_video,
|
| 316 |
-
label="Example Surgical Video"
|
| 317 |
-
)
|
| 318 |
|
| 319 |
gr.Markdown("""
|
| 320 |
## Detected Classes
|
|
|
|
| 278 |
gr.Markdown("Segment surgical instruments in images or videos using DeSAM architecture.")
|
| 279 |
|
| 280 |
with gr.Tabs():
|
| 281 |
+
# Video Tab
|
| 282 |
+
with gr.TabItem("🎬 Video Segmentation"):
|
| 283 |
+
with gr.Row():
|
| 284 |
+
with gr.Column():
|
| 285 |
+
input_video = gr.Video(label="Input Video")
|
| 286 |
+
video_btn = gr.Button("Segment Video", variant="primary")
|
| 287 |
+
with gr.Column():
|
| 288 |
+
output_video = gr.Video(label="Segmentation Result")
|
| 289 |
+
|
| 290 |
+
video_btn.click(fn=predict_video, inputs=input_video, outputs=output_video)
|
| 291 |
+
|
| 292 |
+
gr.Examples(
|
| 293 |
+
examples=["examples/surgical_demo.mp4",
|
| 294 |
+
"examples/output.mp4"],
|
| 295 |
+
inputs=input_video,
|
| 296 |
+
label="Example Surgical Video"
|
| 297 |
+
)
|
| 298 |
# Image Tab
|
| 299 |
with gr.TabItem("🖼️ Image Segmentation"):
|
| 300 |
with gr.Row():
|
|
|
|
| 316 |
label="Example Surgical Images"
|
| 317 |
)
|
| 318 |
|
| 319 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 320 |
|
| 321 |
gr.Markdown("""
|
| 322 |
## Detected Classes
|