DancinParrot

Results 11 comments of DancinParrot

Hi @SkalskiP! Thanks for your response, I wasn't expecting a response this quick actually so no worries! I see, that would explain the error. However, the error was actually raised...

> I'm very sorry. You're right, of course. I mentioned `coco_annotations_to_masks` because there is ongoing work on COCO loading and saving in [#1163](https://github.com/roboflow/supervision/pull/1163), and this method will appear in that...

Just an update, after messing around with a few implementations, I finally came up with a functional code by combining `_coco_segmentation_to_mask()` from [Fiftyone](https://github.com/voxel51/fiftyone/blob/8205caf7646e5e7cb38041a94efb97f6524c1db6/fiftyone/utils/coco.py#L2180) with `mask2polygon()` in ultralytics/JSON2YOLO#38. The flow is...

> I must admit, I am very confused. Initially, I thought it was only about loading COCO annotations consisting of multiple segments. Is that still the case? Yup, still that....

> The easiest way (not the most efficient), but still a lot more efficient than the conversion through all of the representations above, is to loop through lists in `image_annotation["segmentation"]`,...

Hi @SkalskiP ! Thank you so much for your help! Here's the code that I've implemented based on your recommendation and it seems to merge all the polygons very well:...

Hi @SkalskiP ! Thanks for reviewing and providing feedback on my PR! > As I try to keep the code clean, I left a comment proposing a rename to `polygons_to_mask`...

Hi @SkalskiP ! During refactoring, I noticed a very similar function `_polygons_to_mask()` (see [here](https://github.com/roboflow/supervision/blob/2723735b018cf6f8907d4c706b5f759ff641a53d/supervision/dataset/formats/yolo.py#L43)). The function follows a similar methadology in calling `polygon_to_mask()` for each polygon in the input list,...

Hi @SkalskiP ! Any updates on the above?