Skip to content

Conversation

neilmehta24
Copy link
Member

Remove hard-coded image resize, in favor of an argument when making the inference request. Pass in a max image size in demo.py and the tests.

@github-actions github-actions bot added the CLA signed Indicates that all contributors have signed label Oct 22, 2025


def custom_resize(pil_images, max_size=(1000, 1000), should_pad=True):
def custom_resize(pil_images, max_size=None, should_pad=True):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a type hint?

Comment on lines +175 to +176
max_image_size (Optional[int]): Maximum dimension for images (assumes square). Images will be
resized to (max_image_size, max_image_size) if they exceed this size. If None, no resizing.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the code in image_utils.py, I find this comment misleading. When I read it, it sounds like it will resize the image to a square, but we are actually keeping the aspect ratio and setting the longest size to this maximum.

Why not expose this as a tuple[int, int] at this level as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA signed Indicates that all contributors have signed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants