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.4k stars 2.41k forks source link

Incorrect label order for YOLO format. #6416

Open feicccccccc opened 2 months ago

feicccccccc commented 2 months ago

Describe the bug The exported YOLO format class order is incorrect. I did add the cateogray tag in label settings

Example: Hi,

I am experiencing the same issues. Adding category tag does not work. I remember it does work in some previous version, but I forget which one is it.

Example: notes.json

{
  "categories": [
    {
      "id": "2",
      "name": "safe_b"
    },
    {
      "id": "0",
      "name": "safe_h"
    },
    {
      "id": "3",
      "name": "n_safe_b"
    },
    {
      "id": "1",
      "name": "n_safe_h"
    }
  ],
  "info": {
    "year": 2024,
    "version": "1.0",
    "contributor": "Label Studio"
  }
}

classes.txt

safe_b
safe_h
n_safe_b
n_safe_h

The correct order:

  1. safe_h
  2. n_safe_h
  3. safe_b
  4. n_safe_b

I have checked the order for the labels, and it is following the order presented in classes.txt, which is not the correct one.

To Reproduce Export using yolo format

Expected behavior Export the dataset in yolo format with the correct order.

Screenshots If applicable, add screenshots to help explain your problem.

Environment (please complete the following information): docker, tag: heartexlabs/label-studio:latest

Additional context Add any other context about the problem here.

makseq commented 1 month ago

Similar question: https://community.labelstud.io/t/the-yolo-export-has-incorrect-label-names-and-an-altered-category-order-compared-to-the-original-setup-in-label-studio/339/1