fix: add factor=28 to smart_resize in prepare_image for Qwen VL models

#2
by aug6th - opened

Ensure proper image resizing for Qwen VL models by passing factor=28 to smart_resize.

https://github.com/QwenLM/Qwen3-VL/blob/main/qwen-vl-utils/src/qwen_vl_utils/vision_process.py

have we benchmarked this against IBM docling?

have we benchmarked this against IBM docling?

Good question! I haven't benchmarked this against IBM docling yet.

This PR specifically fixes the image preprocessing for Qwen VL models to match their official implementation (factor=28 in smart_resize). It's more of a bug fix than a new feature.

A full benchmark comparison would require significant resources and standardized test datasets. If the community is interested, maybe we could collaborate on this? Otherwise, the Qwen team's own benchmarks might already include comparisons with other document understanding models.

Yes, we can use an ensemble approach where the higher quality model is picked up at runtime instead of one vs other. Of course this would increase latency and processing need. But we will have a second opinion on the output of the primary model.

Ready to merge
This branch is ready to get merged automatically.

Sign up or log in to comment