discopat.nn_models.torch_box_ops

Utilities for bounding box manipulation and GIoU.

Functions

box_cxcywh_to_xyxy(x)

box_iou(boxes1, boxes2)

generalized_box_iou(boxes1, boxes2)

Generalized IoU from https://giou.stanford.edu/.

discopat.nn_models.torch_box_ops.box_cxcywh_to_xyxy(x)[source]
discopat.nn_models.torch_box_ops.box_iou(boxes1, boxes2)[source]
discopat.nn_models.torch_box_ops.generalized_box_iou(boxes1, boxes2)[source]

Generalized IoU from https://giou.stanford.edu/.

The boxes should be in [x0, y0, x1, y1] format

Returns a [N, M] pairwise matrix, where N = len(boxes1) and M = len(boxes2)