Spaces:
Sleeping
Sleeping
srikanthp07
commited on
Commit
Β·
a990ef6
1
Parent(s):
9c0df1e
Update app_gradio.py
Browse files- app_gradio.py +1 -43
app_gradio.py
CHANGED
@@ -20,49 +20,7 @@ device = torch.device(
|
|
20 |
# Description
|
21 |
title = "<center><strong><font size='8'>π Fast Segment Anything π€</font></strong></center>"
|
22 |
|
23 |
-
|
24 |
-
π₯ 2023/07/14: Add a "wider result" button in text mode (Thanks for [gaoxinge](https://github.com/CASIA-IVA-Lab/FastSAM/pull/95)).
|
25 |
-
|
26 |
-
π₯ 2023/06/29: Support the text mode (Thanks for [gaoxinge](https://github.com/CASIA-IVA-Lab/FastSAM/pull/47)).
|
27 |
-
|
28 |
-
π₯ 2023/06/26: Support the points mode. (Better and faster interaction will come soon!)
|
29 |
-
|
30 |
-
π₯ 2023/06/24: Add the 'Advanced options" in Everything mode to get a more detailed adjustment.
|
31 |
-
"""
|
32 |
-
|
33 |
-
description_e = """This is a demo on Github project π [Fast Segment Anything Model](https://github.com/CASIA-IVA-Lab/FastSAM). Welcome to give a star βοΈ to it.
|
34 |
-
|
35 |
-
π― Upload an Image, segment it with Fast Segment Anything (Everything mode). The other modes will come soon.
|
36 |
-
|
37 |
-
βοΈ It takes about 6~ seconds to generate segment results. The concurrency_count of queue is 1, please wait for a moment when it is crowded.
|
38 |
-
|
39 |
-
π To get faster results, you can use a smaller input size and leave high_visual_quality unchecked.
|
40 |
-
|
41 |
-
π£ You can also obtain the segmentation results of any Image through this Colab: [![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1oX14f6IneGGw612WgVlAiy91UHwFAvr9?usp=sharing)
|
42 |
-
|
43 |
-
π A huge thanks goes out to the @HuggingFace Team for supporting us with GPU grant.
|
44 |
-
|
45 |
-
π Check out our [Model Card π](https://huggingface.co/An-619/FastSAM)
|
46 |
-
|
47 |
-
"""
|
48 |
-
|
49 |
-
description_p = """ # π― Instructions for points mode
|
50 |
-
This is a demo on Github project π [Fast Segment Anything Model](https://github.com/CASIA-IVA-Lab/FastSAM). Welcome to give a star βοΈ to it.
|
51 |
-
|
52 |
-
1. Upload an image or choose an example.
|
53 |
-
|
54 |
-
2. Choose the point label ('Add mask' means a positive point. 'Remove' Area means a negative point that is not segmented).
|
55 |
-
|
56 |
-
3. Add points one by one on the image.
|
57 |
-
|
58 |
-
4. Click the 'Segment with points prompt' button to get the segmentation results.
|
59 |
-
|
60 |
-
**5. If you get Error, click the 'Clear points' button and try again may help.**
|
61 |
-
|
62 |
-
"""
|
63 |
-
|
64 |
-
examples = [["examples/sa_8776.jpg"], ["examples/sa_414.jpg"], ["examples/sa_1309.jpg"], ["examples/sa_11025.jpg"],
|
65 |
-
["examples/sa_561.jpg"], ["examples/sa_192.jpg"], ["examples/sa_10039.jpg"], ["examples/sa_862.jpg"]]
|
66 |
|
67 |
default_example = examples[0]
|
68 |
|
|
|
20 |
# Description
|
21 |
title = "<center><strong><font size='8'>π Fast Segment Anything π€</font></strong></center>"
|
22 |
|
23 |
+
examples = [["examples/dogs.jpg"], ["examples/flowers.jpg"], ["examples/fruits.jpg"]]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
|
25 |
default_example = examples[0]
|
26 |
|