Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -8,7 +8,7 @@ from PIL import ImageDraw
|
|
8 |
from torchvision.transforms import ToTensor
|
9 |
|
10 |
from utils.tools import format_results, point_prompt
|
11 |
-
from utils.tools_gradio import fast_process
|
12 |
|
13 |
# Most of our demo code is from [FastSAM Demo](https://huggingface.co/spaces/An-619/FastSAM). Thanks for AN-619.
|
14 |
|
@@ -135,7 +135,8 @@ def segment_with_boxs(
|
|
135 |
annotations = results[0]["segmentation"]
|
136 |
annotations = np.array([annotations])
|
137 |
print(scaled_points.shape)
|
138 |
-
|
|
|
139 |
annotations=annotations,
|
140 |
image=image,
|
141 |
device=device,
|
@@ -214,7 +215,8 @@ def segment_with_points(
|
|
214 |
)
|
215 |
annotations = np.array([annotations])
|
216 |
|
217 |
-
|
|
|
218 |
annotations=annotations,
|
219 |
image=image,
|
220 |
device=device,
|
|
|
8 |
from torchvision.transforms import ToTensor
|
9 |
|
10 |
from utils.tools import format_results, point_prompt
|
11 |
+
from utils.tools_gradio import fast_process, fast_show_mask
|
12 |
|
13 |
# Most of our demo code is from [FastSAM Demo](https://huggingface.co/spaces/An-619/FastSAM). Thanks for AN-619.
|
14 |
|
|
|
135 |
annotations = results[0]["segmentation"]
|
136 |
annotations = np.array([annotations])
|
137 |
print(scaled_points.shape)
|
138 |
+
# change this
|
139 |
+
fig = fast_show_mask(
|
140 |
annotations=annotations,
|
141 |
image=image,
|
142 |
device=device,
|
|
|
215 |
)
|
216 |
annotations = np.array([annotations])
|
217 |
|
218 |
+
# change this
|
219 |
+
fig = fast_show_mask(
|
220 |
annotations=annotations,
|
221 |
image=image,
|
222 |
device=device,
|