compute_iou 函数keras_cv.bounding_box.compute_iou(
boxes1,
boxes2,
bounding_box_format,
use_masking=False,
mask_val=-1,
images=None,
image_shape=None,
)
计算一个包含给定一组框的 IoU 的查找表向量。
如果框未批处理,则查找向量将由 [boxes1_index,boxes2_index] 索引,如果框已批处理,则由 [batch, boxes1_index,boxes2_index] 索引。
用户可以传递不同的秩 boxes1 和 boxes2。例如:1) boxes1: [batch_size, M, 4], boxes2: [batch_size, N, 4] -> 返回 [batch_size, M, N]。2) boxes1: [batch_size, M, 4], boxes2: [N, 4] -> 返回 [batch_size, M, N] 3) boxes1: [M, 4], boxes2: [batch_size, N, 4] -> 返回 [batch_size, M, N] 4) boxes1: [M, 4], boxes2: [N, 4] -> 返回 [M, N]
参数
"xyxy"、"rel_xyxy"、"xyWH"、"center_xyWH"、"yxyx"、"rel_yxyx"。有关支持格式的详细信息,请参见 KerasCV 边界框文档.boxes1 或 boxes2。默认为 False。返回