AAAAAAAyq commited on
Commit
99c2e65
โ€ข
1 Parent(s): 901ea42

Add instructions for points mode

Browse files
Files changed (1) hide show
  1. app.py +10 -13
app.py CHANGED
@@ -19,11 +19,9 @@ news = """ # ๐Ÿ“– News
19
 
20
  ๐Ÿ”ฅ 2023/06/26: Support the points mode. (Better and faster interaction will come soon!)
21
 
22
- """
23
 
24
-
25
-
26
- description_e = """This is a demo on Github project ๐Ÿƒ [Fast Segment Anything Model](https://github.com/CASIA-IVA-Lab/FastSAM).
27
 
28
  ๐ŸŽฏ Upload an Image, segment it with Fast Segment Anything (Everything mode). The other modes will come soon.
29
 
@@ -39,19 +37,18 @@ description_e = """This is a demo on Github project ๐Ÿƒ [Fast Segment Anything
39
 
40
  """
41
 
42
- description_p = """This is a demo on Github project ๐Ÿƒ [Fast Segment Anything Model](https://github.com/CASIA-IVA-Lab/FastSAM).
 
43
 
44
- ๐ŸŽฏ Upload an Image, add points and segment it with Fast Segment Anything (Points mode).
45
 
46
- โŒ›๏ธ 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.
47
 
48
- ๐Ÿš€ To get faster results, you can use a smaller input size and leave high_visual_quality unchecked.
49
 
50
- ๐Ÿ“ฃ 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)
51
 
52
- ๐Ÿ˜š A huge thanks goes out to the @HuggingFace Team for supporting us with GPU grant.
53
-
54
- ๐Ÿ  Check out our [Model Card ๐Ÿƒ](https://huggingface.co/An-619/FastSAM)
55
 
56
  """
57
 
@@ -70,8 +67,8 @@ def segment_everything(
70
  conf_threshold=0.25,
71
  better_quality=False,
72
  withContours=True,
73
- mask_random_color=True,
74
  use_retina=True,
 
75
  ):
76
  input_size = int(input_size) # ็กฎไฟ imgsz ๆ˜ฏๆ•ดๆ•ฐ
77
 
 
19
 
20
  ๐Ÿ”ฅ 2023/06/26: Support the points mode. (Better and faster interaction will come soon!)
21
 
22
+ """
23
 
24
+ 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.
 
 
25
 
26
  ๐ŸŽฏ Upload an Image, segment it with Fast Segment Anything (Everything mode). The other modes will come soon.
27
 
 
37
 
38
  """
39
 
40
+ description_p = """ # ๐ŸŽฏ Instructions for points mode
41
+ 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.
42
 
43
+ 1. Upload an image or choose an example.
44
 
45
+ 2. Choose the point label ('Add mask' means a positive point. 'Remove' Area means a negative point that is not segmented).
46
 
47
+ 3. Add points one by one on the image.
48
 
49
+ 4. Click the 'Segemnt with points prompt' button to get the segmentation results.
50
 
51
+ **5. If you get Error, click the 'Clear points' button and try again may help.**
 
 
52
 
53
  """
54
 
 
67
  conf_threshold=0.25,
68
  better_quality=False,
69
  withContours=True,
 
70
  use_retina=True,
71
+ mask_random_color=True,
72
  ):
73
  input_size = int(input_size) # ็กฎไฟ imgsz ๆ˜ฏๆ•ดๆ•ฐ
74