Skip to content

Update bbx2cpwpw.py - #13

Merged
persts merged 1 commit into
persts:masterfrom
ericnewkirk:master
Apr 15, 2022
Merged

persts merged 1 commit into
persts:masterfrom
ericnewkirk:master

Conversation

@ericnewkirk

Copy link
Copy Markdown
Contributor

Avoid a bug with duplicate labels

I ran into a .bbx file with labels for both 'Red Deer' and 'red deer' for the same photo. Those weren't getting combined correctly in the detections dictionary before import.

        "img_838.jpg": {
            "attribution": "anon",
            "license": "N/A",
            "license_url": "N/A",
            "annotations": [
                {
                    "created_by": "machine",
                    "updated_by": "",
                    "bbox": {
                        "xmin": 0.0,
                        "xmax": 0.28004181385040283,
                        "ymin": 0.37151461839675903,
                        "ymax": 0.6296362280845642
                    },
                    "label": "red deer",
                    "occluded": "N",
                    "truncated": "N",
                    "difficult": "N",
                    "schema": "1.0.0"
                },
                {
                    "created_by": "human",
                    "updated_by": "human",
                    "bbox": {
                        "xmin": 0.9380430643160045,
                        "xmax": 1.0,
                        "ymin": 0.0692172364396041,
                        "ymax": 0.3074950923275191
                    },
                    "label": "Red Deer",
                    "occluded": "N",
                    "truncated": "N",
                    "difficult": "N",
                    "schema": "1.0.0"
                }
            ]
        }
Avoid a bug with duplicate labels
@persts

persts commented Apr 15, 2022

Copy link
Copy Markdown
Owner

This would have origins in the IL2BB process and a discrepancy in the labels provided with the original data versus the analysts BBoxEE config file used during review. While I personally consider this a labeling error, as the 'red deer' bounding box would have had a N/A label displayed in the annotation window entry pulldown, there is nothing in the annotation process preventing this from happening. So this is a good solution for the converter. During export of the training data there is a way to remap labels which makes it a little easy to leave the mixed case labels rather than taking the time to make them consistent.

@persts
persts merged commit 7d5ae91 into persts:master Apr 15, 2022
@ericnewkirk
ericnewkirk deleted the master branch April 26, 2022 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants