Skip to main content

encord_rle_to_coco_rle

Convert an Encord-compatible RLE string to a COCO-compatible RLE counts string. Encord bitmasks are encoded from row-major mask data. COCO RLE counts are encoded from column-major mask data, as produced by pycocotools.

coco_rle_to_encord_rle

Convert a COCO-compatible RLE counts string to an Encord-compatible RLE string. COCO RLE counts are encoded from column-major mask data, as produced by pycocotools. Encord bitmasks are encoded from row-major mask data.

ranges_to_rle_counts

Convert sorted non-overlapping ranges to RLE counts. This is O(number of ranges) rather than O(number of points), making it efficient for large point sets represented as ranges. Arguments:
  • ranges - Sorted list of (start, end) tuples representing inclusive ranges. Ranges must be non-overlapping and sorted by start.
Returns: List of RLE counts alternating between empty and present runs