GenerateBoundingBoxProposals

public final class GenerateBoundingBoxProposals

This op produces Region of Interests from given bounding boxes(bbox_deltas) encoded wrt anchors according to eq.2 in arXiv:1506.01497

The op selects top `pre_nms_topn` scoring boxes, decodes them with respect to anchors, applies non-maximal suppression on overlapping boxes with higher than `nms_threshold` intersection-over-union (iou) value, discarding boxes where shorter side is less than `min_size`. Inputs: `scores`: A 4D tensor of shape [Batch, Height, Width, Num Anchors] containing the scores per anchor at given position `bbox_deltas`: is a tensor of shape [Batch, Height, Width, 4 x Num Anchors] boxes encoded to each anchor `anchors`: A 1D tensor of shape [4 x Num Anchors], representing the anchors. Outputs: `rois`: output RoIs, a 3D tensor of shape [Batch, post_nms_topn, 4], padded by 0 if less than post_nms_topn candidates found. `roi_probabilities`: probability scores of each roi in 'rois', a 2D tensor of shape [Batch,post_nms_topn], padded with 0 if needed, sorted by scores.

Nested Classes

class GenerateBoundingBoxProposals.Options Optional attributes for GenerateBoundingBoxProposals

Public Methods

static GenerateBoundingBoxProposals
create ( Scope scope, Operand <Float> scores, Operand <Float> bboxDeltas, Operand <Float> imageInfo, Operand <Float> anchors, Operand <Float> nmsThreshold, Operand <Integer> preNmsTopn, Operand <Float> minSize, Options... options)
Factory method to create a class wrapping a new GenerateBoundingBoxProposals operation.
static GenerateBoundingBoxProposals.Options
postNmsTopn (Long postNmsTopn)
Output <Float>
roiProbabilities ()
A 2-D float tensor of shape `[num_images, post_nms_topn]` representing the score of the region of interest box in `rois` tensor at the same index.
Output <Float>
rois ()
A 3-D float tensor of shape `[num_images,post_nms_topn,4]` representing the selected region of interest boxes.

Inherited Methods

Public Methods

public static GenerateBoundingBoxProposals create ( Scope scope, Operand <Float> scores, Operand <Float> bboxDeltas, Operand <Float> imageInfo, Operand <Float> anchors, Operand <Float> nmsThreshold, Operand <Integer> preNmsTopn, Operand <Float> minSize, Options... options)

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

Parameters
scope current scope
scores A 4-D float tensor of shape `[num_images, height, width, num_achors]` containing scores of the boxes for given anchors, can be unsorted.
bboxDeltas A 4-D float tensor of shape `[num_images, height, width, 4 x num_anchors]`. encoding boxes with respec to each anchor. Coordinates are given in the form [dy, dx, dh, dw].
imageInfo A 2-D float tensor of shape `[num_images, 5]` containing image information Height, Width, Scale.
anchors A 2-D float tensor of shape `[num_anchors, 4]` describing the anchor boxes. Boxes are formatted in the form [y1, x1, y2, x2].
nmsThreshold A scalar float tensor for non-maximal-suppression threshold.
preNmsTopn A scalar int tensor for the number of top scoring boxes to be used as input.
minSize A scalar float tensor. Any box that has a smaller size than min_size will be discarded.
options carries optional attributes values
Returns
  • a new instance of GenerateBoundingBoxProposals

public static GenerateBoundingBoxProposals.Options postNmsTopn (Long postNmsTopn)

Parameters
postNmsTopn An integer. Maximum number of rois in the output.

public Output <Float> roiProbabilities ()

A 2-D float tensor of shape `[num_images, post_nms_topn]` representing the score of the region of interest box in `rois` tensor at the same index.

public Output <Float> rois ()

A 3-D float tensor of shape `[num_images,post_nms_topn,4]` representing the selected region of interest boxes. Sorted in descending order in scores.