4.2.6 Model Pre-processing API
hbDNNResize()
【Function Prototype】
int32_t hbDNNResize(hbDNNTaskHandle_t *taskHandle, hbDNNTensor *output, const hbDNNTensor *input, const hbDNNRoi *roi, hbDNNResizeCtrlParam *resizeCtrlParam)
【Description】
Resize tasks according to the input parameters.
Note
This interface is compatible with older versions and will not be maintained in the future. If you need to resize the model input, please refer to the hbDNNRoiInfer()
function for model inference.
【Parameters】
- [out]
taskHandle
: Handle pointer to the task. - [in/out]
output
: Output of the resize task. - [in]
input
: Input of the resize task. - [in]
roi
: Roi information of the input. - [in]
resizeCtrlParam
: Parameters to control the resize task.
【Return Type】
- Returns
0
if the API is executed successfully, otherwise it fails.
Note
- Currently, only resizing with the same
hbDNNDataType
is supported, and it must be of theIMG
type. - For inputs of type
HB_DNN_IMG_TYPE_NV12
orHB_DNN_IMG_TYPE_NV12_SEPARATE
, the width and height must be multiples of 2. - The scaling range is
dst / src ∈ [1/185, 256)
. - The original image size should satisfy
1 <= W <= 4080
,16 <= stride <= 4080
, and thestride
must be a multiple of 16. - The output size should satisfy
Wout <= 4080
,Hout <= 4080
. - The
roi
must be inside the image. - Up to 32 resize tasks can exist simultaneously.