You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

mindspore.ops.IOU.rst 1.3 kB

123456789101112131415161718192021222324252627282930313233
  1. mindspore.ops.IOU
  2. =================
  3. .. py:class:: mindspore.ops.IOU(mode='iou')
  4. 计算矩形的IOU,即真实区域和预测区域的交并比。
  5. 根据真实区域和预测区域计算IOU(intersection over union)或IOF(intersection over foreground)。
  6. .. math::
  7. \text{IOU} = \frac{\text{Area of Overlap}}{\text{Area of Union}}
  8. \text{IOF} = \frac{\text{Area of Overlap}}{\text{Area of Ground Truth}}
  9. .. warning::
  10. 在Ascend中,仅支持计算float16数据。为避免溢出,输入长度和宽度在内部按0.2缩放。
  11. **参数:**
  12. - **mode** (string) - 指定计算方法,现支持'iou'(intersection over union)或'iof'(intersection over foreground)模式。默认值:'iou'。
  13. **输入:**
  14. - **anchor_boxes** (Tensor) - 预测区域,shape为(N, 4)的Tensor。"N"表示预测区域的数量,"4"表示"x0"、"y0"、"x1"和"y1"。数据类型为float16或float32。
  15. - **gt_boxes** (Tensor) - 真实区域,shape为(M, 4)的Tensor。"M"表示地面真实区域的数量,"4"表示"x0"、"y0"、"x1"和"y1"。数据类型为float16或float32。
  16. **输出:**
  17. IOU值的Tensor,shape为(M, N)的Tensor,数据类型与 `anchor_boxes` 的相同。
  18. **异常:**
  19. - **KeyError** - `mode` 不是'iou'或'iof'。