!32957 rectify API doc of ops.NMSWithMask

Merge pull request !32957 from looop5/code_docs_NMSWithMask
This commit is contained in:
i-robot 2022-04-16 08:43:21 +00:00 committed by Gitee
commit ca2e44a4b0
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 14 additions and 11 deletions

View File

@ -26,6 +26,6 @@ mindspore.ops.Log
**异常:**
- **TypeError** - `x` 不是Tensor。
- **TypeError** - 在GPU和CPU平台上运行时`x` 的数据类型不是float16、float32或float64。
- **TypeError** - 在Ascend平台上运行时`x` 的数据类型不是float16或float32。
- **TypeError** - 在GPU和CPU平台上运行时 `x` 的数据类型不是float16、float32或float64。
- **TypeError** - 在Ascend平台上运行时 `x` 的数据类型不是float16或float32。

View File

@ -4774,9 +4774,10 @@ class Asin(Primitive):
class NMSWithMask(PrimitiveWithInfer):
r"""
When object detection problem is performed in the computer vision field, object detection algorithm generates
a plurality of bounding boxes. Selects some bounding boxes in descending order of score(Descending order is not
supported in Ascend platform currently). Use the box with the highest score calculate the overlap between other
boxes and the current box, and delete the box based on a certain threshold(IOU). The IOU is as follows,
a plurality of bounding boxes. Use the box with the highest score, calculate the overlap between other boxes and
the current box, and delete the box based on a certain threshold(IOU). On Ascend platform, the input box score is
ignored, which only selects boexs based on the IOU between boxes, which means if you want to remove boxes that has
lower scores, you need to sort the input boxes by score in descending order in advance. The IOU is as follows,
.. math::
\text{IOU} = \frac{\text{Area of Overlap}}{\text{Area of Union}}
@ -4796,14 +4797,16 @@ class NMSWithMask(PrimitiveWithInfer):
The data type must be float16 or float32.
Outputs:
tuple[Tensor], tuple of three tensors, they are selected_boxes, selected_idx and selected_mask.
tuple[Tensor], tuple of three tensors, they are output_boxes, output_idx and selected_mask.
- **selected_boxes** (Tensor) - The shape of tensor is :math:`(N, 5)`. The list of bounding boxes
after non-max suppression calculation.
- **selected_idx** (Tensor) - The shape of tensor is :math:`(N,)`. The indexes list of
valid input bounding boxes.
- **output_boxes** (Tensor) - The shape of tensor is :math:`(N, 5)`. On GPU and CPU platform, it is a sorted
list of bounding boxes by sorting the input `bboxes` in descending order of score. On Ascend platform,
it is same as input `bboxes`.
- **output_idx** (Tensor) - The shape of tensor is :math:`(N,)`. The indexes list of `output_boxes`.
- **selected_mask** (Tensor) - The shape of tensor is :math:`(N,)`. A mask list of
valid output bounding boxes.
valid output bounding boxes. Apply this mask on `output_boxes` to get the list of bounding boxes after
non-max suppression calculation, or apply this mask on `output_idx` to get the indexes list of bounding boxes
after non-max suppression calculation.
Raises:
ValueError: If the `iou_threshold` is not a float number.