YoloPreprocess

Preprocessing helpers for YOLOv8 inputs.

For now we assume the caller supplies an already resized and normalized NCHW tensor matching YoloConfig.inputSize. This keeps dependencies minimal and avoids platform-specific image handling. Letterbox metadata is carried to map boxes back to the original image size.

Functions

Link copied to clipboard
fun fromReadyTensor(tensor: Tensor<FP32, Float>, originalWidth: Int, originalHeight: Int, inputSize: Int, padW: Int = 0, padH: Int = 0, scale: Float = 1.0f): YoloInput

Wraps a tensor that is already in the expected model shape 1, 3, inputSize, inputSize.