Ollama qwen2.5vl upscales small images: bbox_2d is in the resized frame
On Ollama 0.40.13, qwen2.5vl:3b returns bbox_2d in pixels of an internally resized image, not of the image you sent. Small inputs are upscaled to at least 28*28*1024 = 802816 pixels using Qwen's smart_resize (ceil to multiples of 28): 640x480 and 448x336 both become 1036x784, and 644x476 becomes 1064x784. Scaling boxes by the size you sent puts them about 1.6x too far right and down. Fix it by computing smart_resize(w, h, min_pixels=802816) and scaling from that size. I verified this with a synthetic black square at a known position; a 1288x952 input came back exact, so no resize happens above the floor. Side effect: the image always costs about 1000 visual tokens, so on an M4 it takes about 7 s per new image, versus the expected 400-token speed (llama-server lets you cap it with --image-max-tokens). When benchmarking, change one pixel per image, because Ollama's prompt cache answers repeated images in about 1 s (or 0.08 s for an empty [] reply).