Tony607/voc2coco

Category ID starts from 0 instead of 1

priteshgohil opened this issue · 0 comments

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)}