ioumatrix
ioumatrix ¶
Module for iou matrix computation functions
Classes¶
Functions¶
compute_iou_matrix ¶
Computes pairwise IOU matrix for two given sets of boxes
Parameters:
-
anchor_boxes(ndarray) –A tensor with shape
(N, 4)representing anchor bounding boxes where each box is of the format[left, top, right, bottom]. -
gt_boxes(ndarray) –A tensor with shape
(M, 4)representing ground truth bounding boxes where each box is of the format[left, top, right, bottom].
Returns:
-
ndarray–pairwise IOU matrix with shape
(N, M), where the value at 'i'th row -
ndarray–'j'th column holds the IOU between 'i'th box and 'j'th box from
-
ndarray–boxes1 and boxes2 respectively.
Source code in niceml/utilities/ioumatrix.py
compute_iou_matrix_optimized ¶
Computes pairwise IOU matrix for two given sets of boxes.
Computes the same iou matrix as compute_iou_matrix but especially
for big matrices this function more efficient and user fewer memory.
Parameters:
-
anchor_boxes(ndarray) –A tensor with shape
(N, 4)representing anchor bounding boxes where each box is of the format[left, top, right, bottom]. -
gt_boxes(ndarray) –A tensor with shape
(M, 4)representing ground truth bounding boxes where each box is of the format[left, top, right, bottom].
Returns:
-
Union[csr_matrix, ndarray]–pairwise IOU matrix with shape
(N, M), where the value at 'i'th row -
Union[csr_matrix, ndarray]–'j'th column holds the IOU between 'i'th box and 'j'th box from
-
Union[csr_matrix, ndarray]–boxes1 and boxes2 respectively.
Source code in niceml/utilities/ioumatrix.py
get_splitbox_count ¶
Returns the number of boxes to split one box into, where the number is at least 2, but not more than 8
Parameters:
-
element_count(int) –Determine the number of elements in a box
Returns: The number of boxes to split into