Model Post-processing Parameters

The following tables list the configuration parameters required by each model.

Table 1 Parameters for post-processing of the YOLOv3 model (yolov3_tf_bs1_fp16.cfg)

Parameter

Description

Default Value

Value Range

CLASS_NUM

Number of classes.

80

None

BIASES_NUM

Number of anchor widths and heights (18 indicates nine anchors, and each anchor corresponds to a pair of widths and heights).

18

[0, 100]

BIASE

Every two numbers form the width and height of an anchor. For example, 10, 13 indicates the width and height of the first anchor.

10, 13, 16, 30, 33, 23, 30, 61, 62, 45, 59, 119, 116, 90, 156, 198, 373, 326

None

SCORE_THRESH

Threshold for determining whether an object is of a certain class. If the value is greater than the threshold, the object is considered as the class.

0.3

[0.0, 1.0]

OBJECTNESS_THRESH

Threshold for determining whether it is an object. If the value is greater than the threshold, it is an object.

0.3

[0.0, 1.0]

IOU_THRESH

IOU threshold of two enclosures. If the threshold is exceeded, the two frames are considered as one frame.

0.45

[0.0, 1.0]

YOLO_TYPE

Number of output tensors. 3 indicates that three feature maps are output.

3

[0, 16]

ANCHOR_DIM

Number of anchor frames corresponding to each feature map.

3

[0, 16]

MODEL_TYPE

Data layout format. 0 indicates NHWC, 1 indicates NCHW, and 2 indicates NCHWC.

0

None

FRAMEWORK

The value is of the string type. It can be MindSpore, PyTorch, TensorFlow, or Caffe.

TensorFlow

None

SEPARATE_SCORE_THRESH

Threshold corresponding to each class.

The number of SCORE_THRESH (threshold) is determined by CLASS_NUM (quantity). The threshold is separated by commas (,). (The number of thresholds is equal to the value of CLASS_NUM.)

None

Table 2 Parameters for post-processing of the ResNet-50 model (resnet50_aipp_tf.cfg)

Parameter

Description

Default Value

Value Range

CLASS_NUM

Number of classes.

1001

[0, 2000]

SOFTMAX

Indicates whether to perform softmax calculation in postprocessing. It is of the Boolean type.

false

None

TOP_K

Top K classes with the highest possibility.

1

[0, 16]

Table 3 Parameters for post-processing of the Faster R-CNN model (faster_rcnn_uncut.cfg)

Parameter

Description

Default Value

Value Range

CLASS_NUM

Number of classes.

91

[0, 1000]

SCORE_THRESH

Threshold for determining whether an object is of a certain class. If the value is greater than the threshold, the object is considered as the class.

0.5

[0.0, 1.0]

IOU_THRESH

IOU threshold of two enclosures. If the threshold is exceeded, the two frames are considered as one frame.

0.45

[0.0, 1.0]

SEPARATE_SCORE_THRESH

Threshold corresponding to each class.

The number of SCORE_THRESH (threshold) is determined by CLASS_NUM (quantity). The threshold is separated by commas (,). (The number of thresholds is equal to the value of CLASS_NUM.)

None

MODEL_TYPE

The options are as follows:

0: original

1: nms_cut (No non-maximum value suppression is performed on the model.)

2: FPN

0

None

FRAMEWORK

The value can be:

  • TensorFlow
  • MindSpore
  • PyTorch

TensorFlow

None

NMS_FINISHED

Attribute value specific to the old framework, of the Boolean type.

  • false: The model does not contain the NMS operator and NMS operations need to be performed in postprocessing.
  • true: The model contains the NMS operator and NMS operations do not need to be performed in postprocessing.

true

None

Note: The MODEL_TYPE and FRAMEWORK parameters are described as follows:

  • original adapts to the TensorFlow framework.
  • nms_cut adapts to the TensorFlow or MindSpore framework.
  • FPN adapts to the PyTorch framework.
Table 4 Parameters of the SSD_VGG model post-processing (ssd_vgg16_caffe_release.cfg)

Parameter

Description

Default Value

CLASS_NUM

Number of classes.

5

SCORE_THRESH

Target threshold.

0.4

SEPARATE_SCORE_THRESH

Threshold corresponding to each class.

The number of SCORE_THRESH (threshold) is determined by CLASS_NUM (quantity). The threshold is separated by commas (,). (The number of thresholds is equal to the value of CLASS_NUM.)

Table 5 Parameters for postprocessing of the SSD-MobileNet-v1-FPN model (ssd_mobilenetv1_fpn.cfg)

Parameter

Description

Default Value

CLASS_NUM

Number of classes.

3

SCORE_THRESH

Threshold for determining whether an object is of a certain class. If the value is greater than the threshold, the object is considered as the class.

0.5

SEPARATE_SCORE_THRESH

Threshold corresponding to each class.

The number of SCORE_THRESH (threshold) is determined by CLASS_NUM (quantity). The threshold is separated by commas (,). (The number of thresholds is equal to the value of CLASS_NUM.)

Table 6 Parameters for postprocessing of the CRNN model (crnn_ssh_2.cfg)

Parameter

Description

Default Value

Value Range

CLASS_NUM

Number of classes.

0

[0, 10000]

OBJECT_NUM

Maximum number of characters that can be detected.

0

[0, 1000]

BLANK_INDEX

Index value of a blank character.

0

[0, 10000]

WITH_ARGMAX

Whether argmax has been performed on the model backbone.

false

None

Table 7 (Old framework) Parameters of the ResNet feature model post-processing (resnet_feature_caffe_release.cfg)

Parameter

Description

Default Value

ACTIVATION_FUNCTION

Activation function used to activate the model output data.

None

Table 8 (Old framework) Parameters of post-processing of the ResNet model with multiple classification properties (resnet_attribute_caffe_release.cfg)

Parameter

Description

Default Value

ATTRIBUTE_NUM

Number of model output properties.

5

ACTIVATION_FUNCTION

Type of the activation function. Currently, only the sigmoid function is supported.

None

ATTRIBUTE_INDEX

Index of a model output property. Ensure that the number of indexes is the same as the value of ATTRIBUTE_NUM.

None

Table 9 (Old framework) Parameters of post-processing of the ResNet model with binary property classification (resnet_attribute_caffe_release.cfg)

Parameter

Description

Default Value

CLASS_NUM

Number of classes.

5

Table 10 (Old framework) Parameters of YOLOv4 model post-processing (yolov4_pt_bs1_fp16.cfg)

Parameter

Description

Default Value

CLASS_NUM

Number of classes.

80

BIASES_NUM

Number of anchor widths and heights (18 indicates nine anchors, and each anchor corresponds to a pair of widths and heights).

18

BIASES

Every two numbers form the width and height of an anchor. For example, 10, 13 indicates the width and height of the first anchor.

10, 13, 16, 30, 33, 23, 30, 61, 62, 45, 59, 119, 116, 90, 156, 198, 373, 326

SCORE_THRESH

Threshold for determining whether an object is of a certain class. If the value is greater than the threshold, the object is considered as the class.

0.3

OBJECTNESS_THRESH

Threshold for determining whether it is an object. If the value is greater than the threshold, it is an object.

0.3

IOU_THRESH

IOU threshold of two enclosures. If the threshold is exceeded, the two frames are considered as one frame.

0.45

YOLO_TYPE

Number of output tensors. 3 indicates that three feature maps are output.

3

ANCHOR_DIM

Number of anchor frames corresponding to each feature map.

3

MODEL_TYPE

Data layout format. 0 indicates NHWC, and 1 indicates NCHW.

0

FRAMEWORK_TYPE

Model framework. The value 0 indicates PyTorch, and the value 1 indicates MindSpore.

0

SEPARATE_SCORE_THRESH

Threshold corresponding to each class.

The number of SCORE_THRESH (threshold) is determined by CLASS_NUM (quantity). The threshold is separated by commas (,). (The number of thresholds is equal to the value of CLASS_NUM.)

Table 11 Parameters of the YOLOv4 model post-processing (yolov4_pt_bs1_fp16.cfg)

Parameter

Description

Default Value

CLASS_NUM

Number of classes.

80

BIASES_NUM

Number of anchor widths and heights (18 indicates nine anchors, and each anchor corresponds to a pair of widths and heights).

18

BIASES

Every two numbers form the width and height of an anchor. For example, 10, 13 indicates the width and height of the first anchor.

10, 13, 16, 30, 33, 23, 30, 61, 62, 45, 59, 119, 116, 90, 156, 198, 373, 326

SCORE_THRESH

Threshold for determining whether an object is of a certain class. If the value is greater than the threshold, the object is considered as the class.

0.3

OBJECTNESS_THRESH

Threshold for determining whether it is an object. If the value is greater than the threshold, it is an object.

0.3

IOU_THRESH

IOU threshold of two enclosures. If the threshold is exceeded, the two frames are considered as one frame.

0.45

YOLO_TYPE

Number of output tensors. 3 indicates that three feature maps are output.

3

ANCHOR_DIM

Number of anchor frames corresponding to each feature map.

3

MODEL_TYPE

Data layout format. 0 indicates NHWC, 1 indicates NCHW, and 2 indicates NCHWC.

0

FRAMEWORK

The value is of the string type. It can be MindSpore, PyTorch, TensorFlow, or Caffe.

MindSpore

SEPARATE_SCORE_THRESH

Threshold corresponding to each class.

The number of SCORE_THRESH (threshold) is determined by CLASS_NUM (quantity). The threshold is separated by commas (,). (The number of thresholds is equal to the value of CLASS_NUM.)

YOLO_VERSION

YOLO model version in use.

(Mandatory) YOLO_VERSION = 4

Table 12 Parameters of the YOLOv5 model post-processing (yolov5_pt_bs1_fp32.cfg)

Parameter

Description

Default Value

Value Range

CLASS_NUM

Number of classes.

80

[0, 1000]

BIASES_NUM

Number of anchor widths and heights (18 indicates nine anchors, and each anchor corresponds to a pair of widths and heights).

18

[0, 1000]

BIASE

Every two numbers form the width and height of an anchor. For example, 10, 13 indicates the width and height of the first anchor.

10, 13, 16, 30, 33, 23, 30, 61, 62, 45, 59, 119, 116, 90, 156, 198, 373, 326

None

SCORE_THRESH

Threshold for determining whether an object is of a certain class. If the value is greater than the threshold, the object is considered as the class.

0.3

[0.0, 1.0]

OBJECTNESS_THRESH

Threshold for determining whether it is an object. If the value is greater than the threshold, it is an object.

0.3

[0.0, 1.0]

IOU_THRESH

IOU threshold of two enclosures. If the threshold is exceeded, the two frames are considered as one frame.

0.45

[0.0, 1.0]

YOLO_TYPE

Number of output tensors. 3 indicates that three feature maps are output.

3

[0, 1000]

ANCHOR_DIM

Number of anchor frames corresponding to each feature map.

3

[0, 1000]

MODEL_TYPE

Data layout format. 0 indicates NHWC, 1 indicates NCHW, and 2 indicates NCHWC (Currently, only models in PyTorch framework are supported.).

2

[0, 1000]

FRAMEWORK

The value is of the string type. It can be MindSpore, PyTorch, TensorFlow, or Caffe.

PyTorch

None

SEPARATE_SCORE_THRESH

Threshold corresponding to each class.

The number of SCORE_THRESH (threshold) is determined by CLASS_NUM (quantity). The threshold is separated by commas (,). (The number of thresholds is equal to the value of CLASS_NUM.)

None

YOLO_VERSION

YOLO model version in use.

(Mandatory) YOLO_VERSION=5

None

Table 13 (Old framework) Parameters of the FasterRCNN-Fpn or CascadeRCNN-Fpn model post-processing (fasterrcnn.cfg or cascadercnn.cfg)

Parameter

Description

Default Value

SCORE_THRESH

Threshold for determining whether an object is of a certain class. If the value is greater than the threshold, the object is considered as the class. Value 0.3 is used in the test.

0.5

FPN_SWITCH

FPN switch. This parameter must be set to true for both models.

false

Table 14 Parameters for postprocessing of the DeepLabV3+ (TensorFlow) model (deeplabv3.cfg)

Parameter

Description

Default Value

CLASS_NUM

Number of classes.

21

FRAMEWORK_TYPE

Deep learning framework type.

0: TensorFlow framework

Table 15 Parameters for postprocessing of the CTPN model (ctpn_tf.cfg)

Parameter

Description

Default Value

Value Range

IS_ORIENTED

Indicates whether to detect box tilt.

false

None

BOX_IOU_THRESH

IOU threshold of the small box.

0.7

[0.0, 1.0]

TEXT_IOU_THRESH

IOU threshold of the final text box.

0.2

[0.0, 1.0]

TEXT_PROPOSALS_MIN_SCORE

Minimum score for filtering the small box.

0.7

[0.0, 1.0]

LINE_MIN_SCORE

Minimum score for filtering the final text box.

0.9

[0.0, 1.0]

IS_MINDSPORE

Whether the MindSpore framework is used.

false

None

Table 16 Parameters for postprocessing of the CTPN model (ctpn_mindspore.cfg)

Parameter

Description

Default Value

Value Range

IS_ORIENTED

Indicates whether to detect box tilt.

false

None

BOX_IOU_THRESH

IOU threshold of the small box.

0.7

[0.0, 1.0]

TEXT_IOU_THRESH

IOU threshold of the final text box.

0.2

[0.0, 1.0]

TEXT_PROPOSALS_MIN_SCORE

Minimum score for filtering the small box.

0.7

[0.0, 1.0]

LINE_MIN_SCORE

Minimum score for filtering the final text box.

0.9

[0.0, 1.0]

IS_MINDSPORE

Whether the MindSpore framework is used.

true

None

Table 17 Parameters for postprocessing of the ResNet-18 model (resnet18_aipp_tf.cfg)

Parameter

Description

Default Value

CLASS_NUM

Number of classes.

2

Table 18 Parameters for postprocessing of the DeepLabv3 (MindSpore) model (deeplabv3.cfg)

Parameter

Description

Default Value

CLASS_NUM

Number of classes.

21

MODEL_TYPE

Layout of the model inference output data. The value 0 indicates NHWC, and the value 1 indicates NCHW.

1

FRAMEWORK_TYPE

Deep learning framework type.

2: MindSpore framework

Table 19 Parameters for postprocessing of the BERT-Base (Uncased) model (bert.cfg)

Parameter

Description

Default Value

CLASS_NUM

Number of classes.

2

CHECK_MODEL

Checks model compatibility.

false

Table 20 Parameters for postprocessing of the DeepLabV3+ (PyTorch) model (deeplabv3.cfg)

Parameter

Description

Default Value

CLASS_NUM

Number of classes.

21

CHECK_MODEL

Checks model compatibility.

true

MODEL_TYPE

Layout of the model inference output data. The value 0 indicates NHWC, and the value 1 indicates NCHW.

1

FRAMEWORK_TYPE

Deep learning framework type.

Select 1 for the PyTorch framework.

Table 21 Parameters for postprocessing of the U-Net model (unet_simple.cfg)

Parameter

Description

Default Value

CLASS_NUM

Number of classes.

2

POST_TYPE

Model post-processing mode. The value 0 indicates that argmax is performed on the model logits output (NHWC type). The value 1 indicates that the model argmax output (NHW type) is transparently transmitted.

1

RESIZE_TYPE

Interpolation restoration mode of the pixel image. Currently, only the following two modes are supported:

0: Interpolation restoration is not performed.

1: The nearest neighbor interpolation restoration is performed.

1

Table 22 Parameters for postprocessing of the Mask R-CNN model (mask_rcnn_2017.cfg)

Parameter

Description

Default Value

Value Range

CLASS_NUM

Total number of inference categories, excluding the background.

80

[0, 100]

SCORE_THRESH

Confidence score threshold, which can be adjusted based on service scenarios.

0.7

[0.0, 1.0]

IOU_THRESH

IOU threshold, which can be adjusted based on service scenarios.

0.5

[0.0, 1.0]

RPN_MAX_NUM

Maximum number of region proposal networks.

1000

[0, 1000]

MAX_PER_IMG

Maximum value of the prediction box of each image sorted by confidence.

128

[0, 150]

MASK_THREAD_BINARY

Mask threshold of the input RCNN.

0.5

[0.0, 1.0]

MASK_SHAPE_SIZE

Mask shape in mask_rcnn. Only a single parameter is supported to indicate a square.

28

[0, 100]

MODEL_TYPE

The options are as follows:

0: MindSpore

1: PyTorch

0

None

SEPARATE_SCORE_THRESH

Threshold corresponding to each class.

The number of SCORE_THRESH (threshold) is determined by CLASS_NUM (quantity). The threshold is separated by commas (,). (The number of thresholds is equal to the value of CLASS_NUM.)

None

Table 23 Parameters for postprocessing of the Ssd_Mobilenet_v1_Fpn_for_MindSpore model (ssd_mobilenetv1_fpn.cfg)

Parameter

Description

Default Value

Value Range

CLASS_NUM

Number of classes.

81

[0, 100]

SCORE_THRESH

Threshold for determining whether an object is of a certain class. If the value is greater than the threshold, the object is considered as the class.

0.5

[0.0, 1.0]

IOU_THRESH

Threshold of the object overlap degree. If the value is greater than the threshold, two object frames correspond to the same object.

0.6

[0.0, 1.0]

SEPARATE_SCORE_THRESH

Threshold corresponding to each class.

The number of SCORE_THRESH (threshold) is determined by CLASS_NUM (quantity). The threshold is separated by commas (,). (The number of thresholds is equal to the value of CLASS_NUM.)

None

Table 24 Parameters for postprocessing of the OpenPose model (openpose.cfg)

Parameter

Description

Default Value

Value Range

KEYPOINT_NUM

Number of key points, including the background (a background is counted as one).

19

[0, 100]

FILTER_SIZE

Length (or width) of the Gaussian filter kernel.

25

[0, 100]

SIGMA

Variance of the Gaussian filter kernel.

3

[0, 10]

Table 25 Parameters for postprocessing the HigherHRnet model (higherhrnet.cfg)

Parameter

Description

Default Value

Value Range

KEYPOINT_NUM

Number of key points.

17

[0, 20]

SCORE_THRESH

Key point threshold.

0.1

[0.0, 1.0]

Table 26 Parameters for postprocessing of the Unet++ model (unet_nested.cfg)

Parameter

Description

Default Value

Value Range

CLASS_NUM

Number of classes.

3

None

POST_TYPE

Model post-processing mode. The value 0 indicates that argmax is performed on the model logits output (NHWC type). The value 1 indicates that the model argmax output (NHW type) is transparently transmitted.

1

[0, 16]

RESIZE_TYPE

Interpolation restoration mode of the pixel image. Currently, only the following two modes are supported:

0: Interpolation restoration is not performed.

1: The nearest neighbor interpolation restoration is performed.

1

[0, 16]

Table 27 Parameters for postprocessing of RetinaNet model (retinanet_tf.cfg)

Parameter

Description

Default Value

Value Range

CLASS_NUM

Number of dataset types. (The default number of COCO datasets is 80.)

80

[0, 100]

MODEL_TYPE

Model type. Currently, only the TensorFlow model is supported.

0

[0, 100]

SCORE_THRESH

Score threshold.

0.5

[0.0, 1.0]