Taeyoung96 / Yolo-to-COCO-format-converter

Yolo to COCO annotation format converter
MIT License
280 stars 92 forks source link

A bug with multi-annotations on a image #23

Closed ginvu2005 closed 1 year ago

ginvu2005 commented 1 year ago

Thank you for your contribution. I think there is a bug here. "annotation_id" should increase after new annotation append to annotation list. I got problem when I use pycocotools to debug, they just show the last annotation because annotation_id is not unique.

Taeyoung96 commented 1 year ago

@kytaithon
Hi, Thanks for finding the bug!
Can you describe in a little more detail what you were troubled with the annotation_id?

ginvu2005 commented 1 year ago

Hi @Taeyoung96, I think annotation_id should inside the second for loop. For some datasets which have multiple bbox in a image this will cause missing label when people use pycocotools to load datasets (pycocotool don't get diffirent annotation_id for diffirent bbox).

Taeyoung96 commented 1 year ago

@kytaithon Understood, please provide a PR with the bug fixed and I'll merge it. :+1: