[object Object]

[object Object][object Object]undefined
[object Object]

Operator description: Deletes bounding boxes whose scores are less than scoreThreshold and filters out previously selected bounding boxes with high IOU.

[object Object]

Each operator has calls. First, aclnnNonMaxSuppressionGetWorkspaceSize is called to obtain the workspace size required for computation and the executor that contains the operator computation process. Then, aclnnNonMaxSuppression is called to perform computation.

  • [object Object]
  • [object Object]
[object Object]
  • Parameters:

    • boxes (aclTensor*, compute input): aclTensor on the device. The data type can be FLOAT or FLOAT16. are supported. The is supported. The shape is [num_batches, spatial_dimension, 4].

    • scores (aclTensor*, compute input): aclTensor on the device. The data type can be FLOAT or FLOAT16. are supported. The is supported. The shape is [num_batches, num_classes, spatial_dimension].

    • maxOutputBoxesPerClass (aclIntArray*, compute input): maximum number of bounding boxes selected for each class in each batch. aclIntArray on the host. The data type can be INT32. are supported. The is supported. The upper limit is 700.

    • iouThreshold (aclFloatArray*, compute input): aclFloatArray on the host. The data type can be FLOAT. are supported. The is supported. Value range: [0, 1]. It specifies the threshold of IOU to determine whether bounding boxes overlap too much.

    • scoreThreshold (aclFloatArray*, compute input): aclFloatArray on the host. The data type can be FLOAT. are supported. The is supported. Value range: [0, 1]. It specifies the threshold for determining when to remove a bounding box based on the score.

    • centerPointBox (int, compute input): integer on the host. The data type can be INT32. Value range: [0, 1]. It determines the bounding box format. If the value is 0, this parameter is mainly used for TensorFlow models. The data is provided in the (y1, x1, y2, x2) format, where (y1, x1) and (y2, x2) are the coordinates of the bounding boxes on the diagonal. Ensure x1 < x2 and y1 < y2. If the value is 1, this parameter is mainly used for PyTorch models. The data is provided in the (x_center, y_center, width, height) format.

    • selectedIndices (aclTensor*, compute output): aclTensor on the device. The data type can be INT32. are supported. The is supported. The shape is [num_selected_indices, 3]. The data is provided in the [batch_index, class_index, box_index] format.

    • workspaceSize (uint64_t*, output): size of the workspace to be allocated on the device.

    • executor (aclOpExecutor**, output): operator executor, containing the operator computation process.

  • Returns:

    aclnnStatus: status code. For details, see .

[object Object]
[object Object]
  • Parameters:

    • workspace (void*, input): address of the workspace to be allocated on the device.

    • workspaceSize (uint64_t, input): size of the workspace to be allocated on the device, which is obtained by the first-phase API aclnnNonMaxSuppressionGetWorkspaceSize.

    • executor (aclOpExecutor*, input): operator executor, containing the operator computation process.

    • stream (aclrtStream, input): stream for executing the task.

  • Returns:

    aclnnStatus: status code. For details, see .

[object Object]
  1. The upper limit of maxOutputBoxesPerClass is 700. The data types of the input parameters boxes and scores must be the same.
  2. In the FLOAT16 scenario, a computation error may be introduced when operators are sorted and computed to compare with the benchmark.
[object Object]

The following example is for reference only. For details, see .

[object Object]