Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Portrait aspect ratio image embedding #1267

Closed
wants to merge 1 commit into from

Conversation

f-macfarlane95
Copy link

Updated segment_anything.py to allow for portrait and square aspect ratio images as discussed in #1262

  1. Updated compute_image_embedding to calculate the required scale factor to reduce the maximum image dimension to the desired image_size and removed the assertion that assert image.shape[1] > image.shape[0] to allow for portrait and square images.
  2. Identical changes as above, but to compute_polygon_from_points.

Tested on both portrait and square images and both the embedding process and returned polygons seem sensible.

Update segment_anything to allow for portrait and square aspect ratio images.
@f-macfarlane95 f-macfarlane95 changed the title Portrait aspect ration image embedding Portrait aspect ratio image embedding Apr 25, 2023
@wkentaro wkentaro force-pushed the sam branch 2 times, most recently from a7adb23 to aaf8862 Compare April 29, 2023 15:24
@wkentaro
Copy link
Owner

Thanks! Fixed by de2754e

@wkentaro wkentaro closed this Apr 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants