'Convert annotation which can be polygons, uncompressed RLE to RLE.
:return: binary mask (numpy 2D array)'

def annToRLE(self, ann):

    t = self.imgs[ann['image_id']]
    (h, w) = (t['height'], t['width'])
    segm = ann['segmentation']
    if (type(segm) == list):
        raise NotImplementedError('maskUtils    disabled!')
    elif (type(segm['counts']) == list):
        raise NotImplementedError('maskUtils    disabled!')
    else:
        rle = ann['segmentation']
    return rle
