facebookresearch / facebookresearch/sam2

Question about image preprocessing methods in SAM1 and SAM2

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

Description

Hello authors, thank you for your excellent work. I would like to ask why, in SAM1, the image is first resized by its long side to 1024, and then padded for the short side, whereas in SAM2, the image is directly resized to `(1024, 1024)` using `PIL.Image`'s resize method. Wouldn't this cause distortion of the aspect ratio?

Additionally, which resolution and which pixels are the loss applied to during training?

Thank you!

Contributor guide

Open the contributing guide

Research direction

Start with the SAM1 and SAM2 preprocessing paths and the PIL.Image resize call mentioned in the issue. Compare their resize and padding behavior, then identify the training resolution and pixels included in the loss. Done means documenting answers to the aspect-ratio and loss-target questions.

Written by the indexing model from the issue text.

Assessment

Tech stack
jupyter-notebook, python
Domain
computer-vision, documentation, machine-learning
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.