tfm.vision.mask_ops.instance_masks_overlap
Calculates the IoUs and IoAs between the detection masks and the ground truth masks.
tfm.vision.mask_ops.instance_masks_overlap(
boxes: tf.Tensor,
masks: tf.Tensor,
gt_boxes: tf.Tensor,
gt_masks: tf.Tensor,
output_size: List[int],
mask_binarize_threshold: float = 0.5
) -> Tuple[tf.Tensor, tf.Tensor]
IoU: intersection over union.
IoA: intersection over the area of the detection masks.
Args |
boxes
|
a tensor with a shape of [batch_size, N, 4]. The last dimension is
the pixel coordinates in [ymin, xmin, ymax, xmax] form.
|
masks
|
a float tensor with a shape of [batch_size, N, mask_height,
mask_width] representing the instance masks w.r.t. the boxes .
|
gt_boxes
|
a tensor with a shape of [batch_size, M, 4]. The last dimension is
the pixel coordinates in [ymin, xmin, ymax, xmax] form.
|
gt_masks
|
a float tensor with a shape of [batch_size, M, gt_mask_height,
gt_mask_width] representing the instance masks w.r.t. the gt_boxes .
|
output_size
|
two integers that represent the height and width of the output
masks.
|
mask_binarize_threshold
|
a float representing the threshold for binarizing
mask values. Default value is 0.5.
|
Returns |
iou
|
a tensor with as a shape of [batch_size, N, M].
|
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."],[],[]]