convert_to_mask
- cocohelper.utils.segmentation.convert_to_mask(segmentation, height, width, **kwargs)[source]
Converts a segmentation to a binary mask. :param segmentation: the segmentation to convert. :param height: the height of the output mask. :param width: the width of the output mask. :param **kwargs: extra parameters
- Returns:
The binary mask as a numpy array.
- Parameters:
segmentation (Any) –
height (int) –
width (int) –
- Return type:
ndarray