Module vision_preprocess

Module vision_preprocess 

Source
Expand description

2026-09-25: CPU-side image preprocessing for the vision encoder. Decodes a base64 image, resizes it onto a grid of patch_size × spatial_merge_size cells, normalises it with the checkpoint’s mean and std, and lays the patches out as a flat f32 tensor.

Owner: model-layers (vision input). Invariants: none beyond the types.

Functions§

preprocess_image
2026-09-25: Preprocess one base64-encoded image with no max_pixels bound.
preprocess_image_with_max_pixels
2026-09-25: preprocess_image with an optional area bound max_pixels (see target_size_for).