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§
- Preprocess
Result - 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
DynamicImageto 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.