Skip to content

Conversation

@Vision-Kek
Copy link

(height,width) is flipped in add_visual_prompt and add_text_prompt in examples/sam3_image_batched_inference.ipynb:

  • the size of a SAMImage is h, w, not w, h
  • InferenceMetadata also expects (height, width)

Since it's flipped twice, it doesn't affect behavior in the notebook, but w misleadingly stores the height. So either

  • change to h, w = datapoint.images[0].size (current proposal),
  • or, change to w, h = datapoint.images[0].data.size (which would access the PIL Image which is w,h)

The other changed line 84 regarding torch.inference_mode has been concurrently addressed by #245.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant