fromReadyTensor

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

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

Parameters

tensor

normalized tensor (values typically in 0,1)

originalWidth

width of the source image

originalHeight

height of the source image

inputSize

target model resolution (defaults to config.inputSize)

padW

horizontal padding applied during letterbox (pixels)

padH

vertical padding applied during letterbox (pixels)

scale

scaling factor used during letterbox (original -> model space)