Closed mimansa1907 closed 8 months ago
Thanks for writing the issue.
As you said, if ann['iscrowd']: continue
should be commented out.
We updated our general_json2yolo.py script and we confirmed that the RLE mask with "iscrowd": 1
is converted to YOLO segmentation format correctly.
In this update, the RLE mask with holes can be converted to the YOLO segmentation format correctly. We hope this script would help your business.
The RLE mask.
The converted YOLO segmentation format.
On RectLabel, you have 2 options to label the polygon with holes.
Label the polygon with holes using Segment Anything models.
Label the polygon and erase inside the polygon using the Erase polygon tool.
Currently If you need our support to fix this problem, please let us know.
A user told us that converting RLE masks with "iscrowd": 1 to YOLO format might decrease the segmentation accuracy, https://github.com/ultralytics/JSON2YOLO/issues/38#issuecomment-2013148445
We added skip_iscrowd_1 flag to the convert_coco_json()
function in the general_json2yolo.py script.
Please give us your feedback.
Set skip_iscrowd_1=True.
Set skip_iscrowd_1=False.
I am trying to convert the COCO1.0 annotation files generated in CVAT to Yolo format. The COCO json file created consists of segmentation masks in RLE format therefore 'iscrowd' variable is True across all annotations. Based on the code given in the function
convert_coco_json
, the statementif ann['iscrowd']: continue
will skip the rest of the code of for loop statement infor ann in anns:
. I commented theif
condition and after that I am able to create text files, so what is exactly the purpose of this if statement in the function.Code Snippet :