util.box_ops
============

.. py:module:: util.box_ops

.. autoapi-nested-parse::

   Utilities for bounding box manipulation and GIoU.



Functions
---------

.. autoapisummary::

   util.box_ops.generalized_box_iou
   util.box_ops.masks_to_boxes


Module Contents
---------------

.. py:function:: generalized_box_iou(boxes1, boxes2)

   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)


.. py:function:: masks_to_boxes(masks)

   Compute the bounding boxes around the provided masks.

   The masks should be in format [N, H, W] where N is the number of masks, (H, W) are the spatial dimensions.

   Returns a [N, 4] tensors, with the boxes in xyxy format