# tensorflow::ops::NonMaxSuppression Class Reference

# tensorflow::
ops::
NonMaxSuppression

`
#include <image_ops.h>
`


Greedily selects a subset of bounding boxes in descending order of score,.

## Summary


pruning away boxes that have high intersection-over-union (IOU) overlap with previously selected boxes. Bounding boxes are supplied as \[y1, x1, y2, x2\], where (y1, x1) and (y2, x2) are the coordinates of any diagonal pair of box corners and the coordinates can be provided as normalized (i.e., lying in the interval \[0, 1\]) or absolute. Note that this algorithm is agnostic to where the origin is in the coordinate system. Note that this algorithm is invariant to orthogonal transformations and translations of the coordinate system; thus translating or reflections of the coordinate system result in the same boxes being selected by the algorithm. The output of this operation is a set of integers indexing into the input collection of bounding boxes representing the selected boxes. The bounding box coordinates corresponding to the selected indices can then be obtained using the
`
tf.gather operation
`
. For example: selected_indices = tf.image.non_max_suppression( boxes, scores, max_output_size, iou_threshold) selected_boxes = tf.gather(boxes, selected_indices)


Args:

- scope: A [Scope](https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object
- boxes: A 2-D float tensor of shape `
  [num_boxes, 4]
  ` .
- scores: A 1-D float tensor of shape `
  [num_boxes]
  ` representing a single score corresponding to each box (each row of boxes).
- max_output_size: A scalar integer tensor representing the maximum number of boxes to be selected by non max suppression.

<br />


Optional attributes (see
`
https://www.tensorflow.org/versions/r2.5/api_docs/cc/struct/tensorflow/ops/non-max-suppression/attrs#structtensorflow_1_1ops_1_1_non_max_suppression_1_1_attrs
`
):

- iou_threshold: A float representing the threshold for deciding whether boxes overlap too much with respect to IOU.

<br />


Returns:

- `
  https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output
  ` : A 1-D integer tensor of shape `
  [M]
  ` representing the selected indices from the boxes tensor, where `
  M <= max_output_size
  ` .

<br />

| ### Constructors and Destructors ||
|---|---|
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/non-max-suppression#classtensorflow_1_1ops_1_1_non_max_suppression_1a9d86b1cd20b43d62327b4b497d6457d4 (const :: https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope & scope, :: https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input boxes, :: https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input scores, :: https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input max_output_size) ` ||
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/non-max-suppression#classtensorflow_1_1ops_1_1_non_max_suppression_1a1ab4c9ad2a00fb51e1dfd72bc9fc363b (const :: https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope & scope, :: https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input boxes, :: https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input scores, :: https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input max_output_size, const https://www.tensorflow.org/versions/r2.5/api_docs/cc/struct/tensorflow/ops/non-max-suppression/attrs#structtensorflow_1_1ops_1_1_non_max_suppression_1_1_attrs & attrs) ` ||

| ### Public attributes ||
|---|---|
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/non-max-suppression#classtensorflow_1_1ops_1_1_non_max_suppression_1a1959f5a68ba6d16064a93d86a1414712 ` | ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation ` |
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/non-max-suppression#classtensorflow_1_1ops_1_1_non_max_suppression_1ad4219ad3203cc7d4d8c96f8833d367fc ` | ` :: https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output ` |

| ### Public functions ||
|---|---|
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/non-max-suppression#classtensorflow_1_1ops_1_1_non_max_suppression_1a4cad107f2f05bbb87deb2241ecad5f6e () const ` | ` ::tensorflow::Node * ` |
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/non-max-suppression#classtensorflow_1_1ops_1_1_non_max_suppression_1af7a9dd9e033cacef4e2771bdf3998725 () const ` | ` ` |
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/non-max-suppression#classtensorflow_1_1ops_1_1_non_max_suppression_1acb3c005a4bed5fc05b4eaae70457faca () const ` | ` ` |

| ### Public static functions ||
|---|---|
| ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/non-max-suppression#classtensorflow_1_1ops_1_1_non_max_suppression_1a136de54e18cc497fc70fc94659efd6ae (float x) ` | ` https://www.tensorflow.org/versions/r2.5/api_docs/cc/struct/tensorflow/ops/non-max-suppression/attrs#structtensorflow_1_1ops_1_1_non_max_suppression_1_1_attrs ` |

| ### Structs ||
|---|---|
| [tensorflow:: ops:: NonMaxSuppression:: Attrs](https://www.tensorflow.org/versions/r2.5/api_docs/cc/struct/tensorflow/ops/non-max-suppression/attrs) | Optional attribute setters for [NonMaxSuppression](https://www.tensorflow.org/versions/r2.5/api_docs/cc/class/tensorflow/ops/non-max-suppression#classtensorflow_1_1ops_1_1_non_max_suppression) . |

## Public attributes

### operation

```
Operation operation
```

### selected_indices

```
::tensorflow::Output selected_indices
```

## Public functions

### NonMaxSuppression

```
 NonMaxSuppression(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input boxes,
  ::tensorflow::Input scores,
  ::tensorflow::Input max_output_size
)
```

### NonMaxSuppression

```
 NonMaxSuppression(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input boxes,
  ::tensorflow::Input scores,
  ::tensorflow::Input max_output_size,
  const NonMaxSuppression::Attrs & attrs
)
```

### node

```
::tensorflow::Node * node() const 
```

### operator::tensorflow::Input

```
 operator::tensorflow::Input() const 
```

### operator::tensorflow::Output

```
 operator::tensorflow::Output() const 
```

## Public static functions

### IouThreshold

```
Attrs IouThreshold(
  float x
)
```