Skip to content

Conversation

NicolasHug
Copy link
Member

@NicolasHug NicolasHug commented Mar 15, 2024

Closes #8294

We allow the labels_getter parameter of SanitizeBoudingBoxes to return a tuple. Each entry in the tuple gets sanitized/subsampled, along with the boxes. This enables the sanitization of properties like "area" or "iscrowd" from COCO.

cc @vfdev-5

Copy link

pytorch-bot bot commented Mar 15, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/vision/8319

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit c9bd6c8 with merge base 53869eb (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

Copy link
Collaborator

@pmeier pmeier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just minor things. Thanks Nicolas!

labels = tuple(labels)
for entry in labels:
if not isinstance(entry, torch.Tensor):
# TODO: we don't need to enforce tensors, just that entries are indexable as t[bool_mask]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just checking: was this a requirement from the issue or a nice to have?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a nice to have

@NicolasHug NicolasHug merged commit fa82fd3 into pytorch:main Mar 15, 2024
@NicolasHug NicolasHug deleted the sanitize_labels_tuple branch March 15, 2024 15:13
@MarcSzafraniec
Copy link

Thanks ! :)

facebook-github-bot pushed a commit that referenced this pull request Mar 21, 2024
Reviewed By: vmoens

Differential Revision: D55062811

fbshipit-source-id: 2216cc6805bff1c69d3dd7e570b80c927b82d19a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: done
Development

Successfully merging this pull request may close these issues.

Cleaner SanitizeBoundingBoxes transform
4 participants