Update app.py
Browse files
app.py
CHANGED
|
@@ -73,15 +73,19 @@ def show_box(box, ax):
|
|
| 73 |
w, h = box[2] - box[0], box[3] - box[1]
|
| 74 |
ax.add_patch(plt.Rectangle((x0, y0), w, h, edgecolor='green', facecolor=(0, 0, 0, 0), lw=2))
|
| 75 |
|
| 76 |
-
def show_masks(image, masks, scores, point_coords=None, box_coords=None, input_labels=None, borders=
|
| 77 |
masks_store = []
|
| 78 |
for i, (mask, score) in enumerate(zip(masks, scores)):
|
| 79 |
plt.figure(figsize=(10, 10))
|
| 80 |
plt.imshow(image)
|
| 81 |
show_mask(mask, plt.gca(), borders=borders)
|
|
|
|
|
|
|
| 82 |
if point_coords is not None:
|
| 83 |
assert input_labels is not None
|
| 84 |
show_points(point_coords, input_labels, plt.gca())
|
|
|
|
|
|
|
| 85 |
if box_coords is not None:
|
| 86 |
# boxes
|
| 87 |
show_box(box_coords, plt.gca())
|
|
|
|
| 73 |
w, h = box[2] - box[0], box[3] - box[1]
|
| 74 |
ax.add_patch(plt.Rectangle((x0, y0), w, h, edgecolor='green', facecolor=(0, 0, 0, 0), lw=2))
|
| 75 |
|
| 76 |
+
def show_masks(image, masks, scores, point_coords=None, box_coords=None, input_labels=None, borders=False):
|
| 77 |
masks_store = []
|
| 78 |
for i, (mask, score) in enumerate(zip(masks, scores)):
|
| 79 |
plt.figure(figsize=(10, 10))
|
| 80 |
plt.imshow(image)
|
| 81 |
show_mask(mask, plt.gca(), borders=borders)
|
| 82 |
+
|
| 83 |
+
"""
|
| 84 |
if point_coords is not None:
|
| 85 |
assert input_labels is not None
|
| 86 |
show_points(point_coords, input_labels, plt.gca())
|
| 87 |
+
"""
|
| 88 |
+
|
| 89 |
if box_coords is not None:
|
| 90 |
# boxes
|
| 91 |
show_box(box_coords, plt.gca())
|