Skip to content

Conversation

@dongluw
Copy link

@dongluw dongluw commented Dec 5, 2025

What does this PR do?

  • fix a bug in the image resize code, which affects performance
    before fix:
patch_01

after fix:
patch_1

  • add test cases

Fixes # (issue)

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests?

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@dongluw dongluw force-pushed the command_a_vision_fix_1 branch from 4c93a19 to 2450d3d Compare December 5, 2025 04:58
@dongluw dongluw force-pushed the command_a_vision_fix_1 branch from 2450d3d to 3066589 Compare December 5, 2025 05:02
@Rocketknight1
Copy link
Member

cc @molbap @yonigozlan @zucchini-nlp

@molbap
Copy link
Contributor

molbap commented Dec 5, 2025

Hi @dongluw , thanks for the contribution, indeed there seems to be a flip issue. however how do you obtain the test image above? I'm surprised our tests haven't caught this, it should be all wrong, so a reproducer would help

@github-actions
Copy link
Contributor

github-actions bot commented Dec 5, 2025

[For maintainers] Suggested jobs to run (before merge)

run-slow: cohere2_vision

@dongluw
Copy link
Author

dongluw commented Dec 5, 2025

hey @molbap I saved the stacked_images to images patch by patch https://github.com/dongluw/transformers/blob/9ef13ef775fe5a05c634fb2705a500ef59f28763/src/transformers/models/cohere2_vision/image_processing_cohere2_vision_fast.py#L228

this issue only affects generation quality if images are of very high/low aspect ratio

full image is
output_image17

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.

3 participants