HumanSignal / label-studio

Label Studio is a multi-type data labeling and annotation tool with standardized output format
https://labelstud.io
Apache License 2.0
19.02k stars 2.37k forks source link

Import YOLO to LabelStudio doesn't work #3635

Closed Nelsordo closed 1 year ago

Nelsordo commented 1 year ago

Hi, I've an issue when I import pre-annotated data with yolo format to LS. image How you can see it send me an error and the image is not annotated. I have tried many ways but none have worked. This are my steps.

  1. Convert the data using label-studio converter with the following comand label-studio-converter import yolo -i C:\Users\Nelson\Downloads\oilspilldetection.v2i.yolov5pytorch\aaa -o output.json
  2. Move the output to the images folder
  3. import the output.json and the image (I'm using one image for test)
  4. Copy the output.label_config.xml to Label Interface
  5. See the results

I've tried to import the dataset (converted) by local-host and it produces the same error image

The .json file is the following: image And the paths of the files are: "C:\Users\Nelson\Downloads\oilspilldetection.v2i.yolov5pytorch\aaa\images\USR_shadow_2437_fake_png.rf.8d21fc53f30644d6e0952c348b6805c1.jpg" "C:\Users\Nelson\Downloads\oilspilldetection.v2i.yolov5pytorch\aaa\images\output.json"

makseq commented 1 year ago

Most likely it was introduced in this PR: https://github.com/heartexlabs/label-studio-converter/pull/157/files

@p0p4k could you please help with this issue?

makseq commented 1 year ago

Similar issue: https://github.com/heartexlabs/label-studio-converter/issues/193

makseq commented 1 year ago

@Nelsordo Could you switch to this branch and check how it works please? https://github.com/heartexlabs/label-studio-converter/pull/195

Nelsordo commented 1 year ago

I downloaded the branch and run python setup.py install and then label-studio-converter import yolo -i C:\Users\Nelson\Downloads\oilspilldetection.v2i.yolov5pytorch\aaa -o output.json but keep sending the same .json file Maybe is a step where I am doing it wrong, could you please give me a step by step of how to import pre-annotated Dataset in Yolov5 format to Label-Studio using Local Storage? I would appreciate it a lot.

Nelsordo commented 1 year ago

Here are more details. I'm using Win11 and an enviroment in Anaconda3 to use LS. In the documentation says that we have to change this variable LABEL_STUDIO_LOCAL_FILES_DOCUMENT_ROOT=C:\Users\Nelson

makseq commented 1 year ago

@Nelsordo Are you sure you switched to the PR branch?

cd label-studio-converter
git fetch origin fix/yolo-import-image-root
git checkout fix/yolo-import-image-root
pip install -U -e .  # almost the same as python setup.py install 
label-studio-converter import yolo -i .....
Nelsordo commented 1 year ago

Following your instructions the converter has worked diferrent, it now throw me this .json image and it keep sending an error image

p0p4k commented 1 year ago

Did you add source in the project settings? Add the source for your image files and do not click sync.

makseq commented 1 year ago

@p0p4k try again, I made some change:

git pull origin fix/yolo-import-image-root
pip install -U -e .
label-studio-converter import yolo -i .....
makseq commented 1 year ago

Please try the latest master branch, now it should be fixed.

williamAddison commented 1 year ago

Follow up on this, slightly different but same issue, how would you make use of the label studio converter with an S3 storage system? I am having the same URL error and can't seem to use label-studio converter properly on my system