Documentation Index
Fetch the complete documentation index at: https://docs.encord.com/llms.txt
Use this file to discover all available pages before exploring further.
ranges_to_rle_counts
def ranges_to_rle_counts(ranges: Sequence[Tuple[int, int]]) -> List[int]
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