HumanSignal / label-studio-converter

Tools for converting Label Studio annotations into common dataset formats
https://labelstud.io/
262 stars 130 forks source link

Importing from YOLO ("label" to "labels") #149

Closed TByte007 closed 2 years ago

TByte007 commented 2 years ago

When importing from YOLO dataset the generated JSON have "from_name": "label" which leaves the bounding boxes without labels. If I replace all the "from_name": "label" to "from_name": "labels" and it works. I have no idea why I just found out what is the difference from "updated" XML from inside Label Studio and the generated one by label-studio-converter.

PS: I just saw that it generates the XML with this line <RectangleLabels name="labels" toName="image"> and for some reason in the YOLO importer the default value is like this:

def convert_yolo_to_ls(input_dir, out_file,
                       to_name='image', from_name='label', out_type="annotations",
                       image_root_url='/data/local-files/?d=', image_ext='.jpg'): 
makseq commented 2 years ago

Thanks for pointing me to this problem, hope this commit (it's in the master branch now) will help: https://github.com/heartexlabs/label-studio-converter/commit/d20143762823a878e87128392d48463936bde50f