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

Merging coco annotations results in annotation ids being off by one #1022

Closed
burcam opened this issue Dec 6, 2023 · 1 comment · Fixed by #1024
Closed

Merging coco annotations results in annotation ids being off by one #1022

burcam opened this issue Dec 6, 2023 · 1 comment · Fixed by #1024
Labels
question Question, not yet a bug ;)

Comments

@burcam
Copy link
Contributor

burcam commented Dec 6, 2023

Describe the issue

When merging coco annotations using merge_coco_annotations, the resulting annotation file's annotation list skips an id at the merge point (IE it jumps from 5 to 7).
I think the only change needed is to remove the + 1 from https://github.com/DLR-RM/BlenderProc/blob/main/blenderproc/python/writer/CocoWriterUtility.py#L278. annotation["id"] is indexed starting at 1, so right now the first annotation in the target gets assigned 1 + max(annotation["id"] for annotation in existing_coco_annotations["annotations"]) + 1, or 2 more than the max of the original.

Minimal code example

No response

Files required to run the code

No response

Expected behavior

Expected: annotation ids seamlessly increment through the merged coco_annotations.
Actual: annotation ids skip a number at the merge point.
Screenshot from 2023-12-06 15-37-12

BlenderProc version

Version 2.5.0 20th September 2022

@cornerfarmer
Copy link
Member

Thanks a lot for the hint, should be fixed by #1024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question, not yet a bug ;)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants