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
Difference between image_id and id in annotation key of coco annotation format #95
Comments
I have the same question, have you figured it out? |
Having the same doubt? Is that an annotation ID? Meaning does each annotation have it's own ID? |
I emailed info@cocodatset.org this exact question, but got no reply. I found an article on creating your own COCO-style dataset and it appears the "id" is to uniquely identify each annotation. The "image_id", makes sense, but a unique id for each annotations seems overkill. http://www.immersivelimit.com/tutorials/create-coco-annotations-from-scratch |
Yup, it truly was is an overkill to assign a global unique ID to each annotation but that's the way it has to be according to the API. in the pythonAPI it's here in line 95 of coco.py
|
Finally, I figure out the way to create a dataset according to the COCO format. All instance labels should be unique across all images. If you have a list of annotation matrix, e.g, [A_1, A_2, ..., A_n], the anns can be constructed by following these pseudo codes: save_id = 1
for A in [A_1, A_2, ..., A_n]:
for label in label_list_of_A:
label_mask = A==save_id
# use pycocotools to get the annotations from label_mask
# ......
save_id += 1 |
I am making annotation file for my own dataset. I am unable to understand what can be id in annotation key for my dataset?
The text was updated successfully, but these errors were encountered: