Module vision_preprocess

Module vision_preprocess 

Source
Expand description

CPU-side image preprocessing for Qwen3-VL vision inputs.

Decodes base64 JPEG/PNG images, resizes to a grid snapped to patch_size × spatial_merge_size, normalizes with ImageNet stats, and produces a flat f32 tensor ready for the GPU vision encoder.

Functions§

preprocess_image
Preprocess a single base64-encoded image for the Qwen3-VL encoder.
preprocess_image_with_max_pixels
Preprocess an image with an optional max-pixels cap, matching vLLM-style multimodal processor controls. None preserves Atlas’ historical 1280px long-side cap.