![]() |
Class to compute similarity based on Intersection over Union (IOU) metric.
tfm.vision.iou_similarity.IouSimilarity(
mask_val=-1
)
Methods
__call__
__call__(
boxes_1, boxes_2, boxes_1_masks=None, boxes_2_masks=None
)
Compute pairwise IOU similarity between ground truth boxes and anchors.
B: batch_size N: Number of groundtruth boxes. M: Number of anchor boxes.
Args | |
---|---|
boxes_1
|
a float Tensor with M or B * M boxes. |
boxes_2
|
a float Tensor with N or B * N boxes, the rank must be less than
or equal to rank of boxes_1 .
|
boxes_1_masks
|
a boolean Tensor with M or B * M boxes. Optional. |
boxes_2_masks
|
a boolean Tensor with N or B * N boxes. Optional. |
Returns | |
---|---|
A Tensor with shape [M, N] or [B, M, N] representing pairwise iou scores, anchor per row and groundtruth_box per colulmn. |
Input shape:
boxes_1
: [N, 4], or [B, N, 4]boxes_2
: [M, 4], or [B, M, 4]boxes_1_masks
: [N, 1], or [B, N, 1]boxes_2_masks
: [M, 1], or [B, M, 1]
Output shape:
[M, N], or [B, M, N]