facebookresearch / facebookresearch/sam2

bug in sam2_image_predictor:masks_np = masks.squeeze(0).float().detach().cpu().numpy()?

Open
#484 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
19.9k
Forks
2.5k
PR merge metrics
No merged PRs in 30d

Description

if I input a single box and point_label, the squeeze(0) will remove the first dimenson,just like:
input_box_all = [[1]]
input_label_all = np.array([[1300,600,1400,1200]])

masks, scores, logits = predictor.predict(
box=input_box_all,
point_labels=input_label_all,
multimask_output=False
)

masks.shape is [1,H,W]
this should be [1,1,H,W],but squeeze(0) remove the first 1

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.