#include <image_ops.h>
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.
Arguments:
[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.[batch_size, num_boxes, num_classes]
representing a single score corresponding to each box (each row of boxes).Optional attributes (see Attrs
):
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.Returns:
Output
nmsed_boxes: A [batch_size, max_detections, 4] float32 tensor containing the non-max suppressed boxes.Output
nmsed_scores: A [batch_size, max_detections] float32 tensor containing the scores for the boxes.Output
nmsed_classes: A [batch_size, max_detections] float32 tensor containing the classes for the boxes.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. Constructors and Destructors | |
---|---|
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(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 attributes | |
---|---|
nmsed_boxes | |
nmsed_classes | |
nmsed_scores | |
operation | |
valid_detections |
Public static functions | |
---|---|
ClipBoxes(bool x) | |
PadPerClass(bool x) |
Structs | |
---|---|
tensorflow::ops::CombinedNonMaxSuppression::Attrs | Optional attribute setters for CombinedNonMaxSuppression. |
::tensorflow::Output nmsed_boxes
::tensorflow::Output nmsed_classes
::tensorflow::Output nmsed_scores
Operation operation
::tensorflow::Output valid_detections
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( 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 )
Attrs ClipBoxes( bool x )
Attrs PadPerClass( bool x )
© 2020 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/ops/combined-non-max-suppression