mirror of
https://github.com/deepseek-ai/DeepInfer.git
synced 2026-10-29 23:37:28 +08:00
compute_image_layout clamps the width only when width > height * max_wh_ratio, but ImageProcessorAnyRes._is_stretched treated width >= height * max_wh_ratio as stretched. An image whose ratio is exactly at the limit was therefore not clamped by the layout yet still resized by stretching, which distorts it by the patch-alignment rounding (e.g. 800x100 -> 812x112 squeezes the aspect from 8.0 to 7.25), while a one-pixel narrower image kept its aspect ratio. Share one predicate between the layout clamp and the resize so the two cannot drift apart, and cover the boundary with a CPU-only regression test. |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| common.py | ||
| image_processor.py | ||
| mm_processor.py | ||
| text_processor.py | ||