voc2coco
voc2coco copied to clipboard
Category ID starts from 0 instead of 1
COCO expect that class ID starts from 1 as below, https://github.com/Tony607/voc2coco/blob/207f265dfc4afaae0dda229b8c27a91ab7e0494a/voc2coco.py#L14
However, It came to the notice that class ID starts from 0 in output.json.
To fix this issue, change the following line https://github.com/Tony607/voc2coco/blob/207f265dfc4afaae0dda229b8c27a91ab7e0494a/voc2coco.py#L66
to return {name: i+1 for i, name in enumerate(classes_names)}