# tensorflow::ops::CombinedNonMaxSuppression Class Reference

# tensorflow::ops::CombinedNonMaxSuppression

`#include <image_ops.h>`

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

## Summary

This operation performs non_max_suppression on the inputs per batch, across all classes. Prunes 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. Also 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 the final boxes, scores and classes tensor returned after performing non_max_suppression.

Arguments:

- scope: A [Scope](https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object
- boxes: A 4-D float tensor of shape `[batch_size, num_boxes, q, 4]`. If `q` is 1 then same boxes are used for all classes otherwise, if `q` is equal to number of classes, class-specific boxes are used.
- scores: A 3-D float tensor of shape `[batch_size, num_boxes, num_classes]` representing a single score corresponding to each box (each row of boxes).
- max_output_size_per_class: A scalar integer tensor representing the maximum number of boxes to be selected by non max suppression per class
- max_total_size: A scalar representing maximum number of boxes retained over all classes.
- iou_threshold: A 0-D float tensor representing the threshold for deciding whether boxes overlap too much with respect to IOU.
- score_threshold: A 0-D float tensor representing the threshold for deciding when to remove boxes based on score.

<br />

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

- pad_per_class: If false, the output nmsed boxes, scores and classes are padded/clipped to `max_total_size`. If true, the output nmsed boxes, scores and classes are padded to be of length `max_size_per_class`\*`num_classes`, unless it exceeds `max_total_size` in which case it is clipped to `max_total_size`. Defaults to false.
- clip_boxes: If true, assume the box coordinates are between \[0, 1\] and clip the output boxes if they fall beyond \[0, 1\]. If false, do not do clipping and output the box coordinates as it is.

<br />

Returns:

- `https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output` nmsed_boxes: A \[batch_size, max_detections, 4\] float32 tensor containing the non-max suppressed boxes.
- `https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output` nmsed_scores: A \[batch_size, max_detections\] float32 tensor containing the scores for the boxes.
- `https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output` nmsed_classes: A \[batch_size, max_detections\] float32 tensor containing the classes for the boxes.
- `https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output` valid_detections: A \[batch_size\] int32 tensor indicating the number of valid detections per batch item. Only the top num_detections\[i\] entries in nms_boxes\[i\], nms_scores\[i\] and nms_class\[i\] are valid. The rest of the entries are zero paddings.

<br />

| ### Constructors and Destructors ||
|---|---|
| `https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/ops/combined-non-max-suppression#classtensorflow_1_1ops_1_1_combined_non_max_suppression_1a37433d4e2aa6d72fde6172813056fd7e(const ::https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope & scope, ::https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input boxes, ::https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input scores, ::https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input max_output_size_per_class, ::https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input max_total_size, ::https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input iou_threshold, ::https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input score_threshold)` ||
| `https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/ops/combined-non-max-suppression#classtensorflow_1_1ops_1_1_combined_non_max_suppression_1a2ad706eeb5912c87ebbbd6db116d303b(const ::https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope & scope, ::https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input boxes, ::https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input scores, ::https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input max_output_size_per_class, ::https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input max_total_size, ::https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input iou_threshold, ::https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input score_threshold, const https://www.tensorflow.org/versions/r2.3/api_docs/cc/struct/tensorflow/ops/combined-non-max-suppression/attrs#structtensorflow_1_1ops_1_1_combined_non_max_suppression_1_1_attrs & attrs)` ||

| ### Public attributes ||
|---|---|
| `https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/ops/combined-non-max-suppression#classtensorflow_1_1ops_1_1_combined_non_max_suppression_1a26fe07d747c139edcecac96e27a26d8a` | `::https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output` |
| `https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/ops/combined-non-max-suppression#classtensorflow_1_1ops_1_1_combined_non_max_suppression_1a2684d63b2b480538fd1b801cd32d09ae` | `::https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output` |
| `https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/ops/combined-non-max-suppression#classtensorflow_1_1ops_1_1_combined_non_max_suppression_1a979fef315b03030a750668758a75211b` | `::https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output` |
| `https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/ops/combined-non-max-suppression#classtensorflow_1_1ops_1_1_combined_non_max_suppression_1a77c909be6771b9070654cdb791ad3667` | `https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation` |
| `https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/ops/combined-non-max-suppression#classtensorflow_1_1ops_1_1_combined_non_max_suppression_1a01b23f77d5db080eac0d7c43d6be83d7` | `::https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output` |

| ### Public static functions ||
|---|---|
| `https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/ops/combined-non-max-suppression#classtensorflow_1_1ops_1_1_combined_non_max_suppression_1a27f4c9e9f78ab3448359cee869b2db76(bool x)` | `https://www.tensorflow.org/versions/r2.3/api_docs/cc/struct/tensorflow/ops/combined-non-max-suppression/attrs#structtensorflow_1_1ops_1_1_combined_non_max_suppression_1_1_attrs` |
| `https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/ops/combined-non-max-suppression#classtensorflow_1_1ops_1_1_combined_non_max_suppression_1a9f704224f56d8d5a9459e3e5e6ff5e56(bool x)` | `https://www.tensorflow.org/versions/r2.3/api_docs/cc/struct/tensorflow/ops/combined-non-max-suppression/attrs#structtensorflow_1_1ops_1_1_combined_non_max_suppression_1_1_attrs` |

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

## Public attributes

### nmsed_boxes

```
::tensorflow::Output nmsed_boxes
```

### nmsed_classes

```
::tensorflow::Output nmsed_classes
```

### nmsed_scores

```
::tensorflow::Output nmsed_scores
```

### operation

```
Operation operation
```

### valid_detections

```
::tensorflow::Output valid_detections
```

## Public functions

### CombinedNonMaxSuppression

```
 CombinedNonMaxSuppression(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input boxes,
  ::tensorflow::Input scores,
  ::tensorflow::Input max_output_size_per_class,
  ::tensorflow::Input max_total_size,
  ::tensorflow::Input iou_threshold,
  ::tensorflow::Input score_threshold
)
```

### CombinedNonMaxSuppression

```
 CombinedNonMaxSuppression(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input boxes,
  ::tensorflow::Input scores,
  ::tensorflow::Input max_output_size_per_class,
  ::tensorflow::Input max_total_size,
  ::tensorflow::Input iou_threshold,
  ::tensorflow::Input score_threshold,
  const CombinedNonMaxSuppression::Attrs & attrs
)
```

## Public static functions

### ClipBoxes

```
Attrs ClipBoxes(
  bool x
)
```

### PadPerClass

```
Attrs PadPerClass(
  bool x
)
```