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

Remove annotations with negative bounding box values during data cleaning #122

Open
nathanielrindlaub opened this issue Apr 18, 2024 · 0 comments
Assignees

Comments

@nathanielrindlaub
Copy link
Member

Add to clean_cct() function in clean_and_combine_datasets.ipynb. Evidently the Animl frontend is capable of creating bounding boxes in which the xmax is smaller than the xmin, which will produce negative absolute pixel values when we export it to COCO for cameratraps during the relToAbs() bounding box conversion:

https://github.com/tnc-ca-geo/animl-api/blob/3051013ceca4e924d3dcf021ee73ba5baddee3a4/src/task/annotations.js#L441-L449

This was the case for image jldp:76b399ca2fa9100f581878054f55d9bd, object 65b952ec6464959953d157ad. The offending object looked like:

    {
      "bbox": [
        0.36384913133495367,
        0.9380952380952381,
        0.504875926426021,
        0.9317460317460318
      ],
      "locked": true,
      "labels": [
        {
          "type": "manual",
          "conf": 1,
          "bbox": [
            0.36384913133495367,
            0.9380952380952381,
            0.504875926426021,
            0.9317460317460318
          ],
          "validation": {
            "validated": true,
            "userId": "[email protected]",
            "_id": {
              "$oid": "65b952ef013265f8a45afc93"
            },
            "validationDate": {
              "$date": "2024-01-30T19:50:07.458Z"
            }
          },
          "userId": "[email protected]",
          "_id": {
            "$oid": "65b952ef6464959953d157ae"
          },
          "labeledDate": {
            "$date": "2024-01-30T19:50:07.458Z"
          },
          "labelId": "37d964c6-e256-49cb-bc30-ff40f1652262"
        }
      ],
      "_id": {
        "$oid": "65b952ec6464959953d157ad"
      }
    },

Which produces a COCO annotation that looks like:

        {
            "id": "65b952ec6464959953d157ad",
            "image_id": "jldp:76b399ca2fa9100f581878054f55d9bd",
            "category_id": 8,
            "sequence_level_annotation": false,
            "bbox": [
                1801,
                393,
                -12,
                152
            ]
        },
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant