Skip to content

Cleaner SanitizeBoundingBoxes transform #8294

@MarcSzafraniec

Description

@MarcSzafraniec

🚀 The feature

  • A functional version of SanitizeBoundingBoxes
  • A version of SanitizeBoundingBoxes that is aligned with other detection transforms: it should either take a BoundingBoxes TVTensor, or other transforms should be able to take in a dictionary that contains boxes, among others.
  • A version of SanitizeBoundingBoxes that can deal with more keys from that dictionary that just "boxes" and "labels"

Motivation, pitch

SanitizeBoundingBoxes is a transform for bounding boxes that is a bit different from the others, as it doesn't take a bounding box object but a dictionary containing a bounding box object and maybe labels.

So we cannot use it in a transforms.Compose object as we can with other transforms, and have to apply it separately.
Plus, it has no functional version, which forces us to instantiate a transforms object and apply it to said dictionary.

Finally, an important drawback of SanitizeBoundingBoxes is that it subsets the boxes and the labels together, but not other detection features such as area or iscrowd. This is error prone, and this transform should at least be able to accommodate the standard COCO format.

Alternatives

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions