Skip to content

add proper smoke test for prototype transforms #7238

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

Merged
merged 10 commits into from
Feb 14, 2023

Conversation

pmeier
Copy link
Collaborator

@pmeier pmeier commented Feb 13, 2023

Per title. We test two things:

  1. Does the structure of the output match the structure of the input?
  2. If the transform can handle the input (based on Transform._transformed_types) is the type preserved? If not, does the transform pass the input through?

We test this against a plethora of configurations:

  1. CPU / GPU
  2. dict, tuple, list inputs
  3. datapoints.Image, datapoints.Video, PIL.Image.Image, plain torch.Tensor as "core" input

Apart from the "core" input, by default each sample contains more images and videos, bounding boxes in all formats (regular and degenerate ones), detection and segmentation masks, Python builtin types (int, str), other objects (pathlib.Path), a plain tensor, and a numpy array.

cc @vfdev-5 @bjuncek

@pmeier pmeier mentioned this pull request Feb 13, 2023
49 tasks
Copy link
Member

@NicolasHug NicolasHug left a comment

Choose a reason for hiding this comment

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

Some comments already discussed offline

Copy link
Member

@NicolasHug NicolasHug left a comment

Choose a reason for hiding this comment

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

LGTM, thanks a lot!

As discussed offline and as a follow-up we should try to validate that the degenerate bboxes stay degenerate (or potentially passed-through), although this may involve a mechanism we don't have yet

@pmeier pmeier merged commit 1f4a984 into pytorch:main Feb 14, 2023
@pmeier pmeier deleted the test-proto-transforms branch February 14, 2023 13:52
facebook-github-bot pushed a commit that referenced this pull request Mar 28, 2023
Reviewed By: vmoens

Differential Revision: D44416579

fbshipit-source-id: 9c3b0da79fe1270c13b6f705c5894ddd7783911f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants