GithubHelp home page GithubHelp logo

Comments (6)

opyate avatar opyate commented on September 26, 2024 3

For anyone who stumble upon this in the future.

Given:

COCO=/path/to/coco/export
JSON_FILE=$COCO/result.json
IMAGES=$COCO/images

Conversion:

git clone https://github.com/heartexlabs/label-studio-converter.git
cd label-studio-converter
label-studio-converter import coco \
        -i $JSON_FILE \
        --image-root-url=/data/local-files/?d=images \
        -o output.json

Run label studio:

LABEL_STUDIO_LOCAL_FILES_SERVING_ENABLED=true \
LABEL_STUDIO_LOCAL_FILES_DOCUMENT_ROOT=$COCO \
label-studio

Follow the steps spat out by the conversion IN ORDER (repeated here):

  1. Create a new project in Label Studio
  2. Use Labeling Config from "/path/to/your/local/git/clone/of/label-studio-converter/output.label_config.xml"
  3. Setup serving for images [e.g. you can use Local Storage (or others):
    https://labelstud.io/guide/storage.html#Local-storage]
  4. Import "/path/to/your/local/git/clone/of/label-studio-converter/output.json" to the project

Step 3 looks like this:

image

What is IMPORTANT is the relationship between LABEL_STUDIO_LOCAL_FILES_DOCUMENT_ROOT=$COCO and Absolute local path in the screenshot above, and the latter has to be a sub-directory of the former, as per this cryptic bit of documentation:

image

"start from the first directory" is just the relationship I described a moment ago.

from label-studio-converter.

makseq avatar makseq commented on September 26, 2024 1

@opyate

  1. --output should be directory.
  2. are you sure that convertor script sees your images? If it can't find images, no annotations will be added to output json file.

from label-studio-converter.

makseq avatar makseq commented on September 26, 2024 1

Sorry for a late answer, I've just found that you are trying to convert from LS to COCO, instead of COCO => LS.

Check this message:
HumanSignal/label-studio#2806 (comment)

and this YOLO => LS guide:
https://github.com/heartexlabs/label-studio-converter#yolo-to-label-studio-converter
COCO should be similar.

from label-studio-converter.

makseq avatar makseq commented on September 26, 2024 1

Thank you for your great instructions, I think we will use it for our docs about coco import.
BTW I've updated this part of Local storage docs, hope it's more clear now.

from label-studio-converter.

opyate avatar opyate commented on September 26, 2024

--input should be a directory also. I'm getting further, but the code raises an error on this line where it tries to get the result attribute from an annotation.

It doesn't seem as if result is part of annotation according to their schema?

Neither are completed_by, created_at, updated_at, lead_time.

from label-studio-converter.

jiangtangaaaa avatar jiangtangaaaa commented on September 26, 2024

Thank you for your great instructions, I think we will use it for our docs about coco import.感谢您的精彩指示,我想我们会将其用于有关可可导入的文档。 BTW I've updated this part of Local storage docs, hope it's more clear now.顺便说一句,我已经更新了本地存储文档的这一部分,希望现在更清楚了。

Based on your post (HumanSignal/label-studio#2806), I have done the following
python -m venv env
source env/bin/activate
git clone https://github.com/heartexlabs/label-studio-converter.git
cd label-studio-converter
pip install -e .

label-studio-converter import coco -h # just print help

label-studio-converter import coco -i your-input-file.json -o output.json

I've tagged the generated xml and put my image under /home/wjt/data/medical_pic
The data source is also set, but the image still cannot be displayed
Please also help me explain how to do the following
image
image
image

from label-studio-converter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.