Skip to main content

Module vision

Module vision 

Source
Expand description

Optional vision layer: raster plus ONNX runner (#636). Off by default. Optional vision layer: page raster plus ONNX runner (#636).

Behind the vision cargo feature (off by default). No trained model ships; a separate team plugs models in later. This module is infrastructure only:

Input tensors are NCHW f32 in 0.0..=1.0 (bytes divided by 255). Output is the model’s first output, which must be f32.

Structs§

VisionOutput
The output tensor of one model run: shape plus row-major f32 data.
VisionRaster
A page (or crop) rasterized for vision input, row-major.
VisionRunner
An ONNX model loaded from bytes or a path, runnable on a VisionRaster.

Enums§

VisionError
Errors from the vision layer.
VisionPixelFormat
Pixel layout of a VisionRaster.

Constants§

DEFAULT_VISION_DPI
Default rasterization resolution for vision input, in dots per inch.

Functions§

rasterize_page
Rasterize a page to a grayscale or RGB buffer at DEFAULT_VISION_DPI.
rasterize_page_with_dpi
Rasterize a page to a grayscale or RGB buffer at the given dpi.

Type Aliases§

VisionResult
Convenience alias for vision operations.