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

Category ID starts from 0 instead of 1 #9

Open
priteshgohil opened this issue Sep 26, 2020 · 0 comments
Open

Category ID starts from 0 instead of 1 #9

priteshgohil opened this issue Sep 26, 2020 · 0 comments

Comments

@priteshgohil
Copy link

priteshgohil commented Sep 26, 2020

COCO expect that class ID starts from 1 as below,

# PRE_DEFINE_CATEGORIES = {"aeroplane": 1, "bicycle": 2, "bird": 3, "boat": 4,

However, It came to the notice that class ID starts from 0 in output.json.

To fix this issue, change the following line

return {name: i for i, name in enumerate(classes_names)}

to return {name: i+1 for i, name in enumerate(classes_names)}

priteshgohil added a commit to priteshgohil/voc2coco that referenced this issue Sep 26, 2020
priteshgohil added a commit to priteshgohil/voc2coco that referenced this issue Sep 26, 2020
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

No branches or pull requests

1 participant