open-mmlab / playground

A central hub for gathering and showcasing amazing projects that extend OpenMMLab with SAM and other exciting features.
Apache License 2.0
1.1k stars 122 forks source link

error: Label Studio Output Conversion to RLE Format Masks #104

Open TonyMacedonia opened 1 year ago

TonyMacedonia commented 1 year ago

(rtmdet-sam) F:\playground\label_anything>python F:\playground\label_anything\tools\convert_to_rle_mask_coco.py --json_file_path D:/Desktop/4cats/result.json --out_dir F:\images Traceback (most recent call last): File "F:\playground\label_anything\tools\convert_to_rle_mask_coco.py", line 165, in format_to_coco(args) File "F:\playground\label_anything\tools\convert_to_rle_mask_coco.py", line 65, in format_to_coco image_path_from=os.path.join('~/AppData/Local/label-studio/label-studio/media/upload/',os.path.dirname(contents[0]['data']['image']).split('/')[-1]) KeyError: 0

TonyMacedonia commented 1 year ago

When I use the conversion script to convert the json format of label-studio output to COCO format, this error has occurred. How can I solve it?

JimmyMa99 commented 1 year ago

There are two possible reasons for this error: 1. The LS exported JSON is not fully annotated. 2. JSON in a format other that LS is used Maybe you used the result of the previous step to COCO as input to the script, but the script only supports using LS exported JSON input