Filter and remove boxes that are too small or fall outside the image.
tfm.vision.box_ops.filter_boxes(
boxes, scores, image_shape, min_size_threshold
)
Args |
boxes
|
a tensor whose last dimension is 4 representing the coordinates of
boxes in ymin, xmin, ymax, xmax order.
|
scores
|
a tensor whose shape is the same as tf.shape(boxes)[:-1]
representing the original scores of the boxes.
|
image_shape
|
a tensor whose shape is the same as, or broadcastable to
boxes except the last dimension, which is 2, representing [height,
width] of the scaled image.
|
min_size_threshold
|
a float representing the minimal box size in each side
(w.r.t. the scaled image). Boxes whose sides are smaller than it will be
filtered out.
|
Returns |
filtered_boxes
|
a tensor whose shape is the same as boxes but with
the position of the filtered boxes are filled with 0.
|
filtered_scores
|
a tensor whose shape is the same as 'scores' but with
the positinon of the filtered boxes filled with 0.
|