Skip to content

Conversation

@kirklandsign
Copy link
Contributor

No description provided.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 18, 2025
@kirklandsign kirklandsign marked this pull request as draft October 18, 2025 00:54
@kirklandsign kirklandsign marked this pull request as ready for review October 18, 2025 03:12
@kirklandsign kirklandsign requested review from Copilot and lucylq and removed request for lucylq October 18, 2025 03:12
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements image resizing functionality for different model types in an Android LLaMA demo application. The changes introduce model-specific image size configurations and simplify the image resizing logic.

  • Adds a method to determine input image size based on model type (LLAVA_1_5: 336px, GEMMA_3: 896px)
  • Modifies ETImage constructor and resizing methods to accept dynamic side sizes
  • Removes custom toString() method from ModelType enum and replaces aspect-ratio-preserving resize with square resizing

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
ModelType.java Removes custom toString() method for enum values
MainActivity.java Adds getInputImageSideSize() method and updates image processing to use dynamic sizing
ETImage.java Updates constructor and resizing logic to accept configurable side sizes and use square resizing

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

}

return Bitmap.createScaledBitmap(bitmap, finalWidth, finalHeight, false);
return Bitmap.createScaledBitmap(bitmap, sideSize, sideSize, false);
Copy link

Copilot AI Oct 18, 2025

Choose a reason for hiding this comment

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

The change from aspect-ratio-preserving resize to square resizing may distort images. This could negatively impact model performance if the models expect properly proportioned images. Consider whether this change is intentional or if aspect ratio should be preserved.

Copilot uses AI. Check for mistakes.
…llamademo/MainActivity.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@kirklandsign kirklandsign changed the title WIP: Image resize Android resize image for llava and gemma Oct 18, 2025
@kirklandsign kirklandsign merged commit 3e35d6d into main Oct 20, 2025
1 check passed
@kirklandsign kirklandsign deleted the image-size branch October 20, 2025 05:30
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.

3 participants