Skip to content

Commit b610c73

Browse files
committed
print mask info
1 parent cd0c05e commit b610c73

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

task_adapter/sam/tasks/inference_sam_m2m_auto.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ def inference_sam_m2m_auto(model, image, text_size, label_mode='1', alpha=0.1, a
4545
mask_map = np.zeros(image_ori.shape, dtype=np.uint8)
4646
for i, ann in enumerate(sorted_anns):
4747
mask = ann['segmentation']
48+
print(f"{type(mask)=}")
49+
print(f"{mask.dtype=} {mask.shape=} {mask.min()=} {mask.max()=}")
4850
color_mask = np.random.random((1, 3)).tolist()[0]
4951
# color_mask = [int(c*255) for c in color_mask]
5052
demo = visual.draw_binary_mask_with_number(mask, text=str(label), label_mode=label_mode, alpha=alpha, anno_mode=anno_mode)
@@ -100,4 +102,4 @@ def show_anns(anns):
100102
color_mask = np.random.random((1, 3)).tolist()[0]
101103
for i in range(3):
102104
img[:,:,i] = color_mask[i]
103-
ax.imshow(np.dstack((img, m*0.35)))
105+
ax.imshow(np.dstack((img, m*0.35)))

0 commit comments

Comments
 (0)