masks_to_boxes torchvision.ops.masks_to_boxes(masks: Tensor) → Tensor[source] Compute the bounding boxes around the provided masks. Returns a [N, 4] tensor containing bounding boxes. The boxes are in (x1, y1, x2, y2) format with 0 <= x1 <= x2 and .