Skip to content

Conversation

@SolomonLake
Copy link

Description

Introduce background_class83422 so that class_names index from 1, keeping in line with COCO standard format for class names.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

How has this change been tested, please provide a testcase or example of how you tested the change?

Tested in notebook with new training.

Any specific deployment considerations

none

Docs

  • Docs updated? What were the changes:

@Abdul-Mukit
Copy link

@SolomonLake please see this:
#330 (comment)

Original COCO style expects category-id 0 as background. All major CV libraries like Roboflow, Ultralytics, and Detectron2 are getting rid of the background class. All expect the category index to start from 0. Due to this consensus, it is easy to use/swap models trained from different sources. We know the exported model will always produce 0 for a class0. I tried to stick to a similar solution as you proposed, and it caused more pain on both the data management side and in deployment side.

Please consider the solution from Detectron2. It can handle COCO dataset starting from 0, 1, to whatever. Can handle "holes" in categories as we have in COCO dataset.
https://github.com/facebookresearch/detectron2/blob/a9c0821a12ad353fb2a96f019515990d5460c5ac/detectron2/data/datasets/coco.py#L102

https://github.com/facebookresearch/detectron2/blob/a9c0821a12ad353fb2a96f019515990d5460c5ac/detectron2/evaluation/coco_evaluation.py#L237

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants