AAAAAAyq
commited on
Commit
Β·
5350ba4
1
Parent(s):
9724c61
Update the examples
Browse files
app.py
CHANGED
|
@@ -12,10 +12,11 @@ title = "<center><strong><font size='8'>π Fast Segment Anything π€</font></
|
|
| 12 |
news = """ # News
|
| 13 |
|
| 14 |
π₯ Add the 'Advanced options" in Everything mode to get a more detailed adjustment.
|
| 15 |
-
|
| 16 |
-
# π₯ Support the points mode and box mode, text mode will come soon.
|
| 17 |
"""
|
| 18 |
|
|
|
|
|
|
|
|
|
|
| 19 |
description = """This is a demo on Github project π [Fast Segment Anything Model](https://github.com/CASIA-IVA-Lab/FastSAM).
|
| 20 |
|
| 21 |
π― Upload an Image, segment it with Fast Segment Anything (Everything mode). The other modes will come soon.
|
|
|
|
| 12 |
news = """ # News
|
| 13 |
|
| 14 |
π₯ Add the 'Advanced options" in Everything mode to get a more detailed adjustment.
|
|
|
|
|
|
|
| 15 |
"""
|
| 16 |
|
| 17 |
+
|
| 18 |
+
# π₯ Support the points mode and box mode, text mode will come soon.
|
| 19 |
+
|
| 20 |
description = """This is a demo on Github project π [Fast Segment Anything Model](https://github.com/CASIA-IVA-Lab/FastSAM).
|
| 21 |
|
| 22 |
π― Upload an Image, segment it with Fast Segment Anything (Everything mode). The other modes will come soon.
|
tools.py
CHANGED
|
@@ -293,7 +293,7 @@ def fast_show_mask_gpu(
|
|
| 293 |
# clip
|
| 294 |
@torch.no_grad()
|
| 295 |
def retriev(
|
| 296 |
-
model, preprocess, elements
|
| 297 |
) -> int:
|
| 298 |
preprocessed_images = [preprocess(image).to(device) for image in elements]
|
| 299 |
tokenized_text = clip.tokenize([search_text]).to(device)
|
|
|
|
| 293 |
# clip
|
| 294 |
@torch.no_grad()
|
| 295 |
def retriev(
|
| 296 |
+
model, preprocess, elements, search_text: str, device
|
| 297 |
) -> int:
|
| 298 |
preprocessed_images = [preprocess(image).to(device) for image in elements]
|
| 299 |
tokenized_text = clip.tokenize([search_text]).to(device)
|