tfm.vision.iou_similarity.IouSimilarity
Class to compute similarity based on Intersection over Union (IOU) metric.
tfm.vision.iou_similarity.IouSimilarity(
mask_val=-1
)
Methods
__call__
View source
__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]
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
Last updated 2024-02-02 UTC.
[null,null,["Last updated 2024-02-02 UTC."],[],[]]