Update app.py
Browse files
app.py
CHANGED
|
@@ -349,20 +349,43 @@ def seg_track_app():
|
|
| 349 |
with app:
|
| 350 |
gr.Markdown(
|
| 351 |
'''
|
| 352 |
-
<div style="text-align:center;">
|
| 353 |
<span style="font-size:3em; font-weight:bold;">SAM2 for Video Segmentation 🔥</span>
|
| 354 |
</div>
|
| 355 |
-
|
| 356 |
-
|
| 357 |
-
|
| 358 |
-
|
| 359 |
-
|
| 360 |
-
|
| 361 |
-
|
| 362 |
-
|
| 363 |
-
|
| 364 |
-
|
| 365 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 366 |
'''
|
| 367 |
)
|
| 368 |
|
|
@@ -568,7 +591,7 @@ def seg_track_app():
|
|
| 568 |
)
|
| 569 |
|
| 570 |
app.queue(concurrency_count=1)
|
| 571 |
-
app.launch(debug=True, enable_queue=True, share=
|
| 572 |
|
| 573 |
if __name__ == "__main__":
|
| 574 |
seg_track_app()
|
|
|
|
| 349 |
with app:
|
| 350 |
gr.Markdown(
|
| 351 |
'''
|
| 352 |
+
<div style="text-align:center; margin-bottom:20px;">
|
| 353 |
<span style="font-size:3em; font-weight:bold;">SAM2 for Video Segmentation 🔥</span>
|
| 354 |
</div>
|
| 355 |
+
<div style="text-align:center; margin-bottom:10px;">
|
| 356 |
+
<span style="font-size:1.5em; font-weight:bold;">Segment Anything in Medical Images and Videos: Benchmark and Deployment</span>
|
| 357 |
+
</div>
|
| 358 |
+
<div style="text-align:center; margin-bottom:20px;">
|
| 359 |
+
<a href="https://github.com/bowang-lab/MedSAM/tree/MedSAM2">
|
| 360 |
+
<img src="https://badges.aleen42.com/src/github.svg" alt="GitHub" style="display:inline-block; margin-right:10px;">
|
| 361 |
+
</a>
|
| 362 |
+
<a href="https://arxiv.org/abs/2408.03322">
|
| 363 |
+
<img src="https://img.shields.io/badge/arXiv-2408.03322-green?style=plastic" alt="Paper" style="display:inline-block; margin-right:10px;">
|
| 364 |
+
</a>
|
| 365 |
+
<a href="https://github.com/bowang-lab/MedSAMSlicer/tree/SAM2">
|
| 366 |
+
<img src="https://img.shields.io/badge/3D-Slicer-Plugin" alt="3D Slicer Plugin" style="display:inline-block; margin-right:10px;">
|
| 367 |
+
</a>
|
| 368 |
+
<a href="https://drive.google.com/drive/folders/1EXzRkxZmrXbahCFA8_ImFRM6wQDEpOSe?usp=sharing">
|
| 369 |
+
<img src="https://img.shields.io/badge/Video-Tutorial-green?style=plastic" alt="Video Tutorial" style="display:inline-block; margin-right:10px;">
|
| 370 |
+
</a>
|
| 371 |
+
</div>
|
| 372 |
+
<div style="text-align:left; margin-bottom:20px;">
|
| 373 |
+
This API supports using box (generated by scribble) and point prompts for video segmentation with
|
| 374 |
+
<a href="https://ai.meta.com/sam2/" target="_blank">SAM2</a>.
|
| 375 |
+
</div>
|
| 376 |
+
<div style="margin-bottom:20px;">
|
| 377 |
+
<ol style="list-style:none; padding-left:0;">
|
| 378 |
+
<li>1. Upload video file</li>
|
| 379 |
+
<li>2. Select model size and downsample frame rate and run <b>Preprocess</b></li>
|
| 380 |
+
<li>3. Use <b>Stroke to Box Prompt</b> to draw box on the first frame or <b>Point Prompt</b> to click on the first frame.</li>
|
| 381 |
+
<li> Note: The bounding rectangle of the stroke should be able to cover the segmentation target.</li>
|
| 382 |
+
<li>4. Click <b>Segment</b> to get the segmentation result</li>
|
| 383 |
+
<li>5. Click <b>Add New Object</b> to add new object</li>
|
| 384 |
+
<li>6. Click <b>Start Tracking</b> to track objects in the video</li>
|
| 385 |
+
<li>7. Click <b>Reset</b> to reset the app</li>
|
| 386 |
+
<li>8. Download the video with segmentation results</li>
|
| 387 |
+
</ol>
|
| 388 |
+
</div>
|
| 389 |
'''
|
| 390 |
)
|
| 391 |
|
|
|
|
| 591 |
)
|
| 592 |
|
| 593 |
app.queue(concurrency_count=1)
|
| 594 |
+
app.launch(debug=True, enable_queue=True, share=True)
|
| 595 |
|
| 596 |
if __name__ == "__main__":
|
| 597 |
seg_track_app()
|