pytorchcocotools.internal.mask_api.rle_fr_bbox
source module pytorchcocotools.internal.mask_api.rle_fr_bbox
Functions
-
rleFrBbox — Convert bounding boxes to encoded masks.
source rleFrBbox(bb: tv.BoundingBoxes, *, device: TorchDevice | None = None, requires_grad: bool = False) → RLEs
Convert bounding boxes to encoded masks.
Computes column-major RLE directly from bbox coordinates without polygon rasterization. All arithmetic is vectorised over the batch; the final loop only slices pre-computed tensors to build RLE objects.
Parameters
-
bb : tv.BoundingBoxes — The bounding boxes.
-
device : TorchDevice | None — The desired device of the bounding boxes.
-
requires_grad : bool — Whether the bounding boxes require gradients.
Returns
-
RLEs — The RLE encoded masks.