Greedily selects a subset of bounding boxes in descending order of score,
tf.raw_ops.CombinedNonMaxSuppression(
boxes,
scores,
max_output_size_per_class,
max_total_size,
iou_threshold,
score_threshold,
pad_per_class=False,
clip_boxes=True,
name=None
)
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.
Args |
boxes
|
A Tensor of type float32 .
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 Tensor of type float32 .
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 Tensor of type int32 .
A scalar integer tensor representing the maximum number of
boxes to be selected by non max suppression per class
|
max_total_size
|
A Tensor of type int32 .
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.
|
iou_threshold
|
A Tensor of type float32 .
A 0-D float tensor representing the threshold for deciding whether
boxes overlap too much with respect to IOU.
|
score_threshold
|
A Tensor of type float32 .
A 0-D float tensor representing the threshold for deciding when to remove
boxes based on score.
|
pad_per_class
|
An optional bool . Defaults to False .
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
|
An optional bool . Defaults to True .
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.
|
name
|
A name for the operation (optional).
|
Returns |
A tuple of Tensor objects (nmsed_boxes, nmsed_scores, nmsed_classes, valid_detections).
|
nmsed_boxes
|
A Tensor of type float32 .
|
nmsed_scores
|
A Tensor of type float32 .
|
nmsed_classes
|
A Tensor of type float32 .
|
valid_detections
|
A Tensor of type int32 .
|