@Operator public final class CombinedNonMaxSuppression extends PrimitiveOp
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.
Modifier and Type | Class and Description |
---|---|
static class |
CombinedNonMaxSuppression.Options
Optional attributes for
CombinedNonMaxSuppression |
operation
Modifier and Type | Method and Description |
---|---|
static CombinedNonMaxSuppression.Options |
clipBoxes(Boolean clipBoxes) |
static CombinedNonMaxSuppression |
create(Scope scope,
Operand<Float> boxes,
Operand<Float> scores,
Operand<Integer> maxOutputSizePerClass,
Operand<Integer> maxTotalSize,
Operand<Float> iouThreshold,
Operand<Float> scoreThreshold,
CombinedNonMaxSuppression.Options... options)
Factory method to create a class wrapping a new CombinedNonMaxSuppression operation.
|
Output<Float> |
nmsedBoxes()
A [batch_size, max_detections, 4] float32 tensor
containing the non-max suppressed boxes.
|
Output<Float> |
nmsedClasses()
A [batch_size, max_detections] float32 tensor
containing the classes for the boxes.
|
Output<Float> |
nmsedScores()
A [batch_size, max_detections] float32 tensor
containing the scores for the boxes.
|
static CombinedNonMaxSuppression.Options |
padPerClass(Boolean padPerClass) |
Output<Integer> |
validDetections()
A [batch_size] int32 tensor indicating the number of
valid detections per batch item.
|
equals, hashCode, op, toString
public static CombinedNonMaxSuppression create(Scope scope, Operand<Float> boxes, Operand<Float> scores, Operand<Integer> maxOutputSizePerClass, Operand<Integer> maxTotalSize, Operand<Float> iouThreshold, Operand<Float> scoreThreshold, CombinedNonMaxSuppression.Options... options)
scope
- current scopeboxes
- 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 classmaxTotalSize
- A scalar representing maximum number of boxes retained over all classes.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 valuespublic static CombinedNonMaxSuppression.Options padPerClass(Boolean padPerClass)
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 static CombinedNonMaxSuppression.Options clipBoxes(Boolean clipBoxes)
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 Output<Float> nmsedBoxes()
public Output<Float> nmsedScores()
public Output<Float> nmsedClasses()
Copyright © 2022. All rights reserved.