vision icon indicating copy to clipboard operation
vision copied to clipboard

references/segmentation/coco_utils might require merging rles?

Open davidgill97 opened this issue 1 year ago • 1 comments

https://github.com/pytorch/vision/blob/6d7851bd5e2bedc294e40e90532f0e375fcfee04/references/segmentation/coco_utils.py#L27-L41 Above seems to assume that objects are not occluded, not merging rles from frPyObjects. In such case, i think it must be changed to

rles = coco_mask.frPyObjects(polygons, height, width) 
rle = coco_mask.merge(rles)
mask = coco_mask.decode(rle)

Is there any specific reason for this, or am I wrong?

davidgill97 avatar Sep 26 '24 02:09 davidgill97

Hi @crazyboy9103 , thanks for the report. I'm not so familiar with that part of the code-base so I could be way off, but I suspect the logic you're looking for is implemented later in https://github.com/pytorch/vision/blob/6d7851bd5e2bedc294e40e90532f0e375fcfee04/references/segmentation/coco_utils.py#L50-L56 ?

NicolasHug avatar Oct 11 '24 13:10 NicolasHug