# CombinedNonMaxSuppression

public final class **CombinedNonMaxSuppression** Greedily selects a subset of bounding boxes in descending order of score,


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.

<br />

### Nested Classes

|---|---|---|---|
| class | [CombinedNonMaxSuppression.Options](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/CombinedNonMaxSuppression.Options) || Optional attributes for `https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/CombinedNonMaxSuppression` |

### Public Methods

|---|---|
| static [CombinedNonMaxSuppression.Options](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/CombinedNonMaxSuppression.Options) | [clipBoxes](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/CombinedNonMaxSuppression#clipBoxes(java.lang.Boolean))(Boolean clipBoxes) |
| static [CombinedNonMaxSuppression](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/CombinedNonMaxSuppression) | [create](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/CombinedNonMaxSuppression#create(org.tensorflow.op.Scope,%20org.tensorflow.Operand<java.lang.Float>,%20org.tensorflow.Operand<java.lang.Float>,%20org.tensorflow.Operand<java.lang.Integer>,%20org.tensorflow.Operand<java.lang.Integer>,%20org.tensorflow.Operand<java.lang.Float>,%20org.tensorflow.Operand<java.lang.Float>,%20org.tensorflow.op.core.CombinedNonMaxSuppression.Options...))([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, [Operand](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operand)\<Float\> boxes, [Operand](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operand)\<Float\> scores, [Operand](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operand)\<Integer\> maxOutputSizePerClass, [Operand](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operand)\<Integer\> maxTotalSize, [Operand](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operand)\<Float\> iouThreshold, [Operand](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operand)\<Float\> scoreThreshold, [Options...](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/CombinedNonMaxSuppression.Options) options) Factory method to create a class wrapping a new CombinedNonMaxSuppression operation. |
| [Output](https://www.tensorflow.org/api_docs/java/org/tensorflow/Output)\<Float\> | [nmsedBoxes](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/CombinedNonMaxSuppression#nmsedBoxes())() A \[batch_size, max_detections, 4\] float32 tensor containing the non-max suppressed boxes. |
| [Output](https://www.tensorflow.org/api_docs/java/org/tensorflow/Output)\<Float\> | [nmsedClasses](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/CombinedNonMaxSuppression#nmsedClasses())() A \[batch_size, max_detections\] float32 tensor containing the classes for the boxes. |
| [Output](https://www.tensorflow.org/api_docs/java/org/tensorflow/Output)\<Float\> | [nmsedScores](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/CombinedNonMaxSuppression#nmsedScores())() A \[batch_size, max_detections\] float32 tensor containing the scores for the boxes. |
| static [CombinedNonMaxSuppression.Options](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/CombinedNonMaxSuppression.Options) | [padPerClass](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/CombinedNonMaxSuppression#padPerClass(java.lang.Boolean))(Boolean padPerClass) |
| [Output](https://www.tensorflow.org/api_docs/java/org/tensorflow/Output)\<Integer\> | [validDetections](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/CombinedNonMaxSuppression#validDetections())() A \[batch_size\] int32 tensor indicating the number of valid detections per batch item. |

### Inherited Methods

From class [org.tensorflow.op.PrimitiveOp](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/PrimitiveOp)

|---|---|
| final boolean | [equals](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/PrimitiveOp#equals(java.lang.Object))(Object obj) |
| final int | [hashCode](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/PrimitiveOp#hashCode())() |
| [Operation](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operation) | [op](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/PrimitiveOp#op())() Returns the underlying `https://www.tensorflow.org/api_docs/java/org/tensorflow/Operation` |
| final String | [toString](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/PrimitiveOp#toString())() |

From class java.lang.Object

|---|---|
| boolean | equals(Object arg0) |
| final Class\<?\> | getClass() |
| int | hashCode() |
| final void | notify() |
| final void | notifyAll() |
| String | toString() |
| final void | wait(long arg0, int arg1) |
| final void | wait(long arg0) |
| final void | wait() |

## Public Methods

#### public static [CombinedNonMaxSuppression.Options](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/CombinedNonMaxSuppression.Options)
**clipBoxes**
(Boolean clipBoxes)

<br />

##### Parameters

| clipBoxes | 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. |
|---|---|

#### public static [CombinedNonMaxSuppression](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/CombinedNonMaxSuppression)
**create**
([Scope](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/Scope) scope, [Operand](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operand)\<Float\> boxes, [Operand](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operand)\<Float\> scores, [Operand](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operand)\<Integer\> maxOutputSizePerClass, [Operand](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operand)\<Integer\> maxTotalSize, [Operand](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operand)\<Float\> iouThreshold, [Operand](https://www.tensorflow.org/api_docs/java/org/tensorflow/Operand)\<Float\> scoreThreshold, [Options...](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/CombinedNonMaxSuppression.Options) options)

Factory method to create a class wrapping a new CombinedNonMaxSuppression operation.

##### Parameters

| scope | current scope |
| 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). |
| maxOutputSizePerClass | A scalar integer tensor representing the maximum number of boxes to be selected by non max suppression per class |
| maxTotalSize | An int32 scalar representing the maximum number of boxes retained over all classes. Note that setting this value to a large number may result in OOM error depending on the system workload. |
| iouThreshold | A 0-D float tensor representing the threshold for deciding whether boxes overlap too much with respect to IOU. |
| scoreThreshold | A 0-D float tensor representing the threshold for deciding when to remove boxes based on score. |
| options | carries optional attributes values |
|---|---|

##### Returns

- a new instance of CombinedNonMaxSuppression

#### public [Output](https://www.tensorflow.org/api_docs/java/org/tensorflow/Output)\<Float\>
**nmsedBoxes**
()

A \[batch_size, max_detections, 4\] float32 tensor
containing the non-max suppressed boxes.

#### public [Output](https://www.tensorflow.org/api_docs/java/org/tensorflow/Output)\<Float\>
**nmsedClasses**
()

A \[batch_size, max_detections\] float32 tensor
containing the classes for the boxes.

#### public [Output](https://www.tensorflow.org/api_docs/java/org/tensorflow/Output)\<Float\>
**nmsedScores**
()

A \[batch_size, max_detections\] float32 tensor
containing the scores for the boxes.

#### public static [CombinedNonMaxSuppression.Options](https://www.tensorflow.org/api_docs/java/org/tensorflow/op/core/CombinedNonMaxSuppression.Options)
**padPerClass**
(Boolean padPerClass)

<br />

##### Parameters

| padPerClass | 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. |
|---|---|

#### public [Output](https://www.tensorflow.org/api_docs/java/org/tensorflow/Output)\<Integer\>
**validDetections**
()

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.