Updated on 2022-03-13 GMT+08:00

AIPP Verification of the Model Input Size

If static or dynamic AIPP is configured, the size (input_size) of the generated image received by the Da Vinci model is changed due to operations such as crop and padding. In the model inference phase, the OME verifies the size of the input image. In dynamic AIPP mode, the input size must be less than or equal to max_src_image_size. In static AIPP mode, calculate the input size according to Table 1.

For static AIPP, assume that the batch count of the model is N, the image width is src_image_size_w, and the height width is src_image_size_h. Table 1 describes the verification formulas for the size of the model input.

Table 1 input_size verification formulas

input_format

input_size

YUV400_U8

N * src_image_size_w * src_image_size_h

YUV420SP_U8

N * src_image_size_w * src_image_size_h * 1.5

XRGB8888_U8

N * src_image_size_w * src_image_size_h * 4

RGB888_U8

N * src_image_size_w * src_image_size_h * 3

The OMG adds a model input before a model with dynamic AIPP is generated, according to the following formula:

sizeof(kAippDynamicPara) + (batch_count – 1) x sizeof(kAippDynamicBatchPara)