srikanthp07 commited on
Commit
a990ef6
Β·
1 Parent(s): 9c0df1e

Update app_gradio.py

Browse files
Files changed (1) hide show
  1. 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
- news = """ # πŸ“– News
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