convert_to_mode

cocohelper.utils.segmentation.convert_to_mode(segmentation, mode, height, width, **kwargs)[source]

Converts a segmentation to the specified mode. :param segmentation: the segmentation to convert. :param mode: the mode to convert the segmentation to. :param height: the height of the output mask. :param width: the width of the output mask. :param **kwargs: extra parameters

Returns:

The segmentation in the specified mode.

Parameters:
  • segmentation (Any) –

  • mode (str) –

  • height (int) –

  • width (int) –

Return type:

Any