get_segmentation_mode

cocohelper.utils.segmentation.get_segmentation_mode(segmentation)[source]

Automatically detect the segmentation format: RLE, cRLE or polygon.

The detection is based on the standard of coco format, where polygons are represented as lists, RLE as an object with size and counts properties, and cRLE as a string.

Parameters:

segmentation (Union[List[List], Dict, str]) – the segmentation to inspect.

Returns:

The segmentation mode as a string.

Return type:

str