mindspore/docs/api/api_python/ops/mindspore.ops.CombinedNonMa...

36 lines
3.4 KiB
ReStructuredText
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

mindspore.ops.CombinedNonMaxSuppression
========================================
.. py:class:: mindspore.ops.CombinedNonMaxSuppression(clip_boxes=True, pad_per_class=False)
根据分数降序使用非极大抑制法通过遍历所有可能的边界框Bounding Box来选择一个最优的结果。
参数:
- **clip_boxes** (bool, 可选) - 如果为True则假设边界框坐标在[0,1]之间,如果超出[0,1]则剪辑输出框。如果为False则不进行剪切并按原样输出框坐标。默认值True。
- **pad_per_class** (bool, 可选) - 如果为True输出 `nmsed_boxes``nmsed_scores``nmsed_classes` 将被填充为 `max_output_size_per_class` * num_classes的长度如果该长度超过 `max_total_size` ,在这种情况下它将被裁剪为 `max_total_size` 。如果为False则输出 `nmsed_boxes``nmsed_scores``nmsed_classes` 将被填充/裁剪到 `max_total_size` 。默认值False。
输入:
- **boxes** (Tensor) - Shape可表示为(batch_size, num_boxes, q, 4)。如果q为1则对所有类都使用相同的边界框如果q等于类的数量则对于每一类都使用特定的边界框。数据类型float32。
- **scores** (Tensor) - 表示对应于每个Bounding Boxes( `boxes` 的每一行)的单个分数数据类型必须为float32其shape可表示为(batch_size, num_boxes, num_classes)。
- **max_output_size_per_class** (Tensor) - 0D Tensor表示每个类中由非极大抑制法non-max suppression选择的Bounding Boxes数目的上限。数据类型int32。
- **max_total_size** (Tensor) - 0D Tensor表示在所有类中可保留的Bounding Boxes数目的上限。数据类型int32。
- **iou_threshold** (Tensor) - 0D Tensor判断Bounding Boxes是否与IOU重叠过多的阈值取值必须在[0,1]区间内。数据类型float32。
- **score_threshold** (Tensor) - 0D Tensor表示根据 `score` 判断何时删除Bounding Boxes的阈值。数据类型float32。
输出:
- **nmsed_boxes** (Tensor) - 包含由非极大抑制法选择出来的Bounding Boxesshape为(batch_size, num_detection, 4)数据类型为float32。
- **nmsed_scores** (Tensor) - 包含每个box的分数shape为(batch_size, num_detection)数据类型为float32。
- **nmsed_classes** (Tensor) - 包含每个box的类别shape为(batch_size, num_detection)数据类型为float32。
- **valid_detections** (Tensor) - 表示每个batch的有效检测数shape为(batch_size,)数据类型为int32。
异常:
- **TypeError** - `boxes``scores``iou_threshold``score threshold` 的数据格式不是float32。
- **TypeError** - `max_output_size_per_class``max_total_size` 的数据格式不是int32。
- **ValueError** - `boxes` 不是4维Tensor。
- **ValueError** - `max_output_size_per_class``max_total_size``iou_threshold``score threshold` 不是0D Tensor。
- **ValueError** - `boxes``scores` 的shape[0]或shape[1]不一致。
- **ValueError** - `boxes``scores` 的shape[2]不一致或 `boxes` 的shape[2]不为1。
- **ValueError** - `scores` 不是3D Tensor。
- **ValueError** - `max_total_size` 小于0。
- **ValueError** - `max_output_size_per_class` 小于0。
- **ValueError** - `iou_threshold` 取值不在区间[0,1]中。