Skip to main content

Module preprocessing

Module preprocessing 

Source
Expand description

Image preprocessing for YOLO inference.

This module handles all image preprocessing operations needed before running YOLO model inference, including resizing, padding, and normalization.

Structs§

PreprocessResult
Result of preprocessing an image, containing the tensor and transform info.

Constants§

LETTERBOX_COLOR
Default letterbox padding color (gray).

Functions§

array_to_tensor
Convert a raw HWC u8 array to a normalized NCHW tensor.
calculate_rect_size
Calculate target size for rectangular inference mode.
clip_coords
Clip coordinates to image bounds.
image_to_array
Convert a DynamicImage to an HWC ndarray.
preprocess_image
Preprocess an image for YOLO inference.
preprocess_image_center_crop
Preprocess an image for YOLO classification (Center Crop).
preprocess_image_with_precision
Preprocess an image for YOLO inference with optional FP16 output.
scale_coords
Scale coordinates from model output space back to original image space.