Skip to content

pytorchcocotools.internal.mask_api.rle_encode

source module pytorchcocotools.internal.mask_api.rle_encode

Functions

  • rleEncode Encode binary masks using RLE.

source rleEncode(mask: Annotated[tv.Mask, 'N H W'], *, device: TorchDevice | None = None, requires_grad: bool | None = None)RLEs

Encode binary masks using RLE.

Parameters

  • mask : Annotated[tv.Mask, 'N H W'] The binary masks to encode.

  • device : TorchDevice | None The desired device of the bounding boxes.

  • requires_grad : bool | None Whether the bounding boxes require gradients.

Returns

  • RLEs description