def _RleCompress(masks):
    'Compresses mask using Run-length encoding provided by pycocotools.\n\n  Args:\n    masks: uint8 numpy array of shape [mask_height, mask_width] with values in\n    {0, 1}.\n\n  Returns:\n    A pycocotools Run-length encoding of the mask.\n  '
    rle = mask.encode(np.asfortranarray(masks))
    rle['counts'] = six.ensure_str(rle['counts'])
    return rle
Compresses mask using Run-length encoding provided by pycocotools.

Args:
  masks: uint8 numpy array of shape [mask_height, mask_width] with values in
  {0, 1}.

Returns:
  A pycocotools Run-length encoding of the mask.
def _RleCompress(masks):
    'Compresses mask using Run-length encoding provided by pycocotools.\n\n  Args:\n    masks: uint8 numpy array of shape [mask_height, mask_width] with values in\n    {0, 1}.\n\n  Returns:\n    A pycocotools Run-length encoding of the mask.\n  '
    rle = mask.encode(np.asfortranarray(masks))
    rle['counts'] = six.ensure_str(rle['counts'])
    return rle