Repository navigation
Write annotation id and area in COCO output - #102
Open
lorinczszabolcs wants to merge 1 commit into
Open
lorinczszabolcs wants to merge 1 commit into
lorinczszabolcs wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What has changed and why?
Closes #97.
id, sequential from 1, and anarea. pycocotools indexes annotations byidand readsareafor every annotation that is not a crowd.get_coco_areacomputes it from the COCO segmentation."iscrowd": 0.COCOevalreadsiscrowdfor every ground truth annotation, so without it the evaluation fails withKeyError: 'iscrowd'. RT-DETR output uses the same code and also gets the three fields.Ids from a COCO input file are not kept, because the label model has no id field. The output numbers the annotations from 1.
How has it been tested?
idandareafor polygons, RLE masks and boxes, and the area helper for multi-part polygons and RLE.coco_to_cocointegration tests ignoreidandareain the output too, because the output numbers and computes them itself.make all-checkspasses with 198 passed and 1 skipped, on Python 3.8 and 3.15.idandarea. The COCO object detection fixture gives bbox AP 1.0, with the script below.check_bbox_pycocotools.py
Run it with
uv run --with pycocotools python check_bbox_pycocotools.py tests/fixtures/object_detection/COCO/train.json out.json.