Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Objective Detection using COCO classes: first label placed to the end of the list #2088

Open
2 tasks done
jinzishuai opened this issue Aug 26, 2020 · 2 comments
Open
2 tasks done
Assignees
Labels
bug Something isn't working

Comments

@jinzishuai
Copy link

jinzishuai commented Aug 26, 2020

My actions before raising this issue

Expected Behaviour

I am training a model using YOLOv5 and the objects are labelled using the 80 classes of COCO:

names: ['person', 'bicycle', 'car', 'motorcycle', 'airplane', 'bus', 'train', 'truck', 'boat', 'traffic light',
        'fire hydrant', 'stop sign', 'parking meter', 'bench', 'bird', 'cat', 'dog', 'horse', 'sheep', 'cow',
        'elephant', 'bear', 'zebra', 'giraffe', 'backpack', 'umbrella', 'handbag', 'tie', 'suitcase', 'frisbee',
        'skis', 'snowboard', 'sports ball', 'kite', 'baseball bat', 'baseball glove', 'skateboard', 'surfboard',
        'tennis racket', 'bottle', 'wine glass', 'cup', 'fork', 'knife', 'spoon', 'bowl', 'banana', 'apple',
        'sandwich', 'orange', 'broccoli', 'carrot', 'hot dog', 'pizza', 'donut', 'cake', 'chair', 'couch',
        'potted plant', 'bed', 'dining table', 'toilet', 'tv', 'laptop', 'mouse', 'remote', 'keyboard', 'cell phone',
        'microwave', 'oven', 'toaster', 'sink', 'refrigerator', 'book', 'clock', 'vase', 'scissors', 'teddy bear',
        'hair drier', 'toothbrush']

I am having a bit of challengens creating a labeling task in CVAT. I am able to generate the 80 labels in JSON format but it seems that CVAT will reorder them labels by placing the first label in the last, therefore breaking the original order of COCO.

Current Behaviour

  • the labels provided to CVAT are in the original COCO order
  • CVAT re-order them like
[
  {
    "name": "bicycle",
    "id": 3,
    "color": "#f13fb8",
    "attributes": []
  },
  {
    "name": "car",
    "id": 4,
    "color": "#60f58f",
    "attributes": []
  },
  {
    "name": "motorcycle",
    "id": 5,
    "color": "#ec669a",
    "attributes": []
  },

...
]

image

Note that "person" is the first entry in the COCO list.

Possible Solution

It seems that we have a bug in the placement of the first label to the very end.

Steps to Reproduce (for bugs)

  1. create a new task in CVAT with 3 labels in the order of "person", "bicycle", "car" or just upload the following json
[
  {
    "name": "person",
    "color": "#330df0",
    "attributes": []
  },
  {
    "name": "bicycle",
    "color": "#4226d1",
    "attributes": []
  },
  {
    "name": "car",
    "color": "#ff6037",
    "attributes": []
  }
]
  1. observe that the resulting task reordered the labels: first label is moved to the last
[
  {
    "name": "car",
    "id": 45449,
    "color": "#ff6037",
    "attributes": []
  },
  {
    "name": "bicycle",
    "id": 45448,
    "color": "#4226d1",
    "attributes": []
  },
  {
    "name": "person",
    "id": 45447,
    "color": "#330df0",
    "attributes": []
  }
]

image

Context

It is my understanding that the order of the labels are important for machine learning trainings since in the end, each label is represented as a integer number such as 41 for the "cup" class. If the data is now labelled with a different number, then the model will be completely wrong.

Your Environment

https://cvat.org/tasks/10146

Next steps

You may join our Gitter channel for community support.

@jinzishuai jinzishuai changed the title Objective Detection using COCO labels Objective Detection using COCO classes: ordering of the labels Aug 26, 2020
@jinzishuai
Copy link
Author

jinzishuai commented Aug 26, 2020

Please note that I originally thought CVAT reorders the labels alphabetically but after further look at the resulting labels (screenshot above), they are actually not alphabetic either.

In fact, the problem is only that the first entry is moved to the very last while the order of the other labels remain unchanged.

@jinzishuai jinzishuai changed the title Objective Detection using COCO classes: ordering of the labels Objective Detection using COCO classes: first label placed to the end of the list Aug 26, 2020
@azhavoro azhavoro added the enhancement New feature or request label Nov 30, 2020
@azhavoro azhavoro added this to the Backlog milestone Nov 30, 2020
@nmanovic nmanovic added bug Something isn't working and removed enhancement New feature or request labels Nov 26, 2021
@nmanovic nmanovic removed this from the Backlog milestone Nov 26, 2021
@ActiveChooN ActiveChooN self-assigned this Dec 9, 2021
@ActiveChooN
Copy link
Contributor

@jinzishuai, can you please check if #3987 would resolve the issue?

@bsekachev bsekachev assigned bsekachev and unassigned ActiveChooN Nov 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants