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
。傳回值