Help Center/
Atlas 300 Application (Model 3000)/
Model Conversion Guide/
AIPP Configuration/
Configuration File Template
Updated on 2022-03-13 GMT+08:00
Configuration File Template
The following describes the configuration file.
# The AIPP configuration starts with the aipp_op flag, which indicates that it is the configuration of an AIPP operator. Multiple aipp_op flags can be configured. aipp_op { # # AIPP provides the following features: CSC, cropping, mean subtraction, multiplication factor, data exchange between channels, and single-line mode. # The input images must in the UINT8 data type. # To use this configuration file, delete the comments of parameters to be configured and set the parameter values as required. # The parameter values in the template are default values. The input_format attribute is mandatory, while other attributes are optional. #========================= Global settings (start) ====================================================================================================================== # aipp_mode specifies the AIPP mode. This parameter is mandatory. # Type: enum # Value range: dynamic or static (dynamic indicates dynamic AIPP, and static indicates static AIPP.) # aipp_mode: # related_input_rank is optional. It indicates the processing start of the inputs. The default value is 0, which indicates that AIPP processing starts from input 0. For example, if the model has two inputs, to have the AIPP processing start from the second input, set related_input_rank to 1. # Type: int # Value range: ≥ 0 # related_input_rank: 0 # input_edge_idx is optional. If a model input is shared by multiple operators, that is, the data operator is followed by more operators, set this parameter to perform different AIPP processing for different output dimensions of the Data operator. # Type: int # Value range: ≥ 0 # input_edge_idx: 0 #========================= Global settings (end) ====================================================================================================================== #========================= Dynamic AIPP settings (start) ============================================================================================= # Maximum size of the input image (must be greater than or equal to that of the source image) # Type: int # max_src_image_size: 0 # Whether to enable rotation. This parameter is reserved. Rotation is not supported currently. # Type: bool # Value range: true (yes) or false (no) # support_rotation: false #========================= Dynamic AIPP settings (end) ============================================================================================= #========================= Static AIPP settings (start) ============================================================================================ # Input image format # Type: enum # Value: YUV420SP_U8, XRGB8888_U8, RGB888_U8, or YUV400_U8 # input_format : # Image width and height # Type: uint13 # Value range: [0, 4096]. For YUV420SP_U8 images, the value must be an even number. # Note: Set src_image_size_w and src_image_size_h to the actual image width and height respectively. If they are not set or set to 0, the width and height defined in the network input are used. # src_image_size_w: 0 # src_image_size_h: 0 # c_padding_value: 0.0 #========= Crop settings (For the configuration example, see section AIPP Configuration > Crop/Padding Configuration.) ========= # Whether to enable crop in AIPP # Type: bool # Value range: true (yes) or false (no) # crop :false # Horizontal and vertical coordinates of the crop start. W and H defined in the network input are used as the size of the cut out image. # Type: uint13 # Value range: [0, 4096]. For YUV420SP_U8 images, the value must be an even number. # Note: load_start_pos_w plus W defined in the network input must be less than or equal to src_image_size_w. load_start_pos_h plus H defined in the network input must be less than or equal to src_image_size_h. # load_start_pos_w: 0 # load_start_pos_h: 0 # Size of the cut out image # Type: uint13 # Value range: even number within [0, 4096], load_start_pos_w + crop_size_w ≤ src_image_size_w, and load_start_pos_h + crop_size_h ≤ src_image_size_h # crop_size_w: 0 # crop_size_h: 0 #========================= Resize settings ======================== # Whether to enable resize. This parameter is reserved. Rotation is not supported currently. # Type: bool # Value range: true (yes) or false (no) resize :false # Width and height of the resized image. This parameter is reserved. Resize is not supported currently. # Type: uint13 # Value range: even number within [0, 4096], less than src_image_size resize_output_w: 0 resize_output_h: 0 #========= Padding settings (For the configuration example, see section AIPP Configuration > Crop/Padding Configuration.) ========= # Whether to enable padding in AIPP # Type: bool # Value range: true (yes) or false (no) # padding: false # Padding in the C direction, for static AIPP # Type: float16 # left_padding_size: 0 # right_padding_size: 0 # top_padding_size: 0 # bottom_padding_size: 0 #================================ Rotation settings ================================== # Rotation angle. This parameter is reserved. Rotation is not supported currently. # Type: uint8 # Value range: {0, 1, 2, 3}, where, 0 indicates zero rotation, 1 indicates 90° clockwise rotation, 2 indicates 180° clockwise rotation, and 3 indicates 270° clockwise rotation. # rotation_angle :0 #========= CSC settings (For the configuration example, see section AIPP Configuration > CSC Configuration.) ============= # Whether to enable CSC in static AIPP # Type: bool # Value: true or false. The value true indicates enabled, and the value false indicates disabled. # csc_switch :false # Whether to enable R/B or U/V channel swap before CSC # Type: bool # Value: true or false. The value true indicates enabled, and the value false indicates disabled. # rbuv_swap_switch: false # Whether to enable single line mode (in this mode, only the first line of the cut out image is processed) # Type: bool # Value: true or false. The value true indicates enabled, and the value false indicates disabled. # single_line_mode: false # If the CSC is disabled (false), this function is bypassed. # If the input image has four channels, the first channel is ignored. # YUV2BGR conversion: # | B | | matrix_r0c0 matrix_r0c1 matrix_r0c2 | | Y - input_bias_0 | # | G | = | matrix_r1c0 matrix_r1c1 matrix_r1c2 | | U - input_bias_1 | >> 8 # | R | | matrix_r2c0 matrix_r2c1 matrix_r2c2 | | V - input_bias_2 | # BGR2YUV conversion: # | Y | | matrix_r0c0 matrix_r0c1 matrix_r0c2 | | B | | output_bias_0 | # | U | = | matrix_r1c0 matrix_r1c1 matrix_r1c2 | | G | >> 8 + | output_bias_1 | # | V | | matrix_r2c0 matrix_r2c1 matrix_r2c2 | | R | | output_bias_2 | # Elements in a 3 x 3 CSC matrix # Type: int16 # Value range: [–32768, +32767] # matrix_r0c0 :298 # matrix_r0c1 :516 # matrix_r0c2 :0 # matrix_r1c0 :298 # matrix_r1c1 :-100 # matrix_r1c2 :-208 # matrix_r2c0 :298 # matrix_r2c1 :0 # matrix_r2c2 :409 # Output bias for RGB2YUV conversion # Type: uint8 # Value range: [0, 255] # output_bias_0: 16 # output_bias_1: 128 # output_bias_2: 128 # Input bias for YUV2RGB conversion # Type: uint8 # Value range: [0, 255] # input_bias_0: 16 # input_bias_1: 128 # input_bias_2: 128 #============================== Mean subtraction and multiplication factor settings ================================= # The computation rules are as follows: # For uint8->uint8, this function is bypassed. # For uint8->int8: pixel_out_chx(i) = pixel_in_chx(i) – mean_chn_i # For uint8->fp16: pixel_out_chx(i) = [pixel_in_chx(i) – mean_chn_i – min_chn_i] * var_reci_chn # Mean value of channel n # Type: uint8 # Value range: [0, 255] # mean_chn_0: 0 # mean_chn_1: 0 # mean_chn_2: 0 # Minimum value of channel n # Type: float16 # Value range: [–65504, +65504] # min_chn_0 :0.0 # min_chn_1 :0.0 # min_chn_2 :0.0 # Standard deviation of channel n or reciprocal of (Max. – Min.) # Type: float16 # Value range: [–65504, +65504] # var_reci_chn_0: 1.0 # var_reci_chn_1: 1.0 # var_reci_chn_2: 1.0 } #========================= Static AIPP settings (end) ============================================================================================
Parent topic: AIPP Configuration
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot