--insert_op_conf

Description

Sets the configuration file directory (including the file name) of an operator to be inserted, for example, the AIPP operator for data preprocessing.

After this option is used, the input data type must be UINT8.

See Also

Argument

Argument: Directory (including the name) of the configuration file of the operator to be inserted.

Format: The directory (including the file name) can contain letters, digits, underscores (_), hyphens (-), periods (.), and Chinese characters.

Remarks: The file name extension is not limited to .cfg, but the content in the configuration file must be in .prototxt format.

Suggestions and Benefits

None

Example

The AIPP operator is used as an example, as shown in the following template of the configuration file (insert_op.cfg is assumed as the file name). See AIPP for more details about the configuration file.

aipp_op {
    aipp_mode:static
    input_format:YUV420SP_U8
    csc_switch:true
    var_reci_chn_0:0.00392157
    var_reci_chn_1:0.00392157
    var_reci_chn_2:0.00392157
}

Upload the configured insert_op.cfg file to any directory (for example, $HOME/module) on the server where ATC is located.

--insert_op_conf=$HOME/module/insert_op.cfg

Applicability

Atlas 200/300/500 Inference Product

Atlas Training Series Product

Dependencies and Restrictions

  • If you have configured static AIPP with the dynamic shape range specified by --input_shape:

    If the model has only one input, this scenario is not supported. If the model has multiple inputs, you must configure different input nodes accordingly, such as setting one input node with static AIPP and another node with a dynamic shape.

  • If you have configured the static AIPP function and set the dynamic image size (unfixed width and height of each input image) using --dynamic_image_size:

    The cropping and padding functions cannot be enabled in the AIPP configuration file, and the values of src_image_size_w and src_image_size_h must be set to 0 in the configuration file.

  • If you have configured dynamic AIPP with the dynamic shape range specified by --input_shape, the width and height of the AIPP output must be within the range specified by --input_shape.
  • If you have configured the dynamic AIPP function and set the dynamic batch size using --dynamic_batch_size:

    In your inference code, call the aclmdlSetInputAIPP API provided by AscendCL to set dynamic AIPP parameters. Ensure that batchSize is set to the maximum batch size. For details about the APIs, see aclmdlSetInputAIPP.

  • If you have configured the dynamic AIPP function and set the dynamic image size (unfixed width and height of each input image) using --dynamic_image_size:

    In your inference code, call the aclmdlSetInputAIPP API provided by AscendCL to set dynamic AIPP parameters. Ensure that cropping and padding are disabled. In this scenario, ensure that the width and height configured by calling aclmdlSetInputAIPP are the same as those configured by calling aclmdlSetDynamicHWSize. That is, the width and height must be set to the maximum dynamic image size. For details about the APIs, see Model Execution.