Add Initial Qwen-2.5VL Image Processor Support#1008
Merged
sayanshaw24 merged 7 commits intomainfrom Nov 26, 2025
Merged
Conversation
added 2 commits
November 11, 2025 16:17
apsonawane
reviewed
Nov 14, 2025
added 2 commits
November 19, 2025 15:49
…sions into sayanshaw/qwen2-5-vl
…sions into sayanshaw/qwen2-5-vl
…sions into sayanshaw/qwen2-5-vl
hanbitmyths
reviewed
Nov 24, 2025
hanbitmyths
reviewed
Nov 24, 2025
hanbitmyths
approved these changes
Nov 26, 2025
apsonawane
approved these changes
Nov 26, 2025
tianleiwu
reviewed
Dec 5, 2025
| } | ||
|
|
||
| // Add batch dimension (frames = 1 initially) and prepare patches vector | ||
| std::vector<float> patches = chw; |
There was a problem hiding this comment.
We shall avoid such vector copy.
I think we can allocate with padded space. Fill them with padded value. Then apply HWC -> CHW (need to compute destination offset with padded height / width).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR introduces support for Qwen2.5-VL image preprocessing in ONNX Runtime Extensions. It implements the full resize (including smart resize) → rescale → normalize → patching pipeline required by
Qwen2.5-VL-7B-Instruct.Key updates:
New Qwen2.5-VL–compatible
PatchImageopSmart Resize support in the
Resizeopsmart_resizebehavior from the HF transformersQwen2.5-VL Normalization handling
Qwen2.5-VL processor JSON
mean/stdnormalizationpatch_size,merge_size,temporal_patch_size)RGB Correctness Guarantees
PatchImageThis enables ORT Extensions processing support for Qwen2.5-VL vision & multimodal models across ORT Extensions, ready-to-use in ORT GenAI. Note that we currently only provide single-image and non-video support.
Validation
pixel_valuesmatch reference output; MSE comparison: achieved ≤1e-3