Skip to content

cleanup prototype transforms functional tests #6622

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 4 commits into from
Sep 22, 2022
Merged

Conversation

pmeier
Copy link
Collaborator

@pmeier pmeier commented Sep 21, 2022

This PR cleans up the recent changes to our prototype transforms functional test frameworks. It merges the files test_prototype_transforms_kernels.py and test_prototype_transforms_dispatchers.py into test_prototype_transforms_functional.py while removing any obsolete code in the latter.

From here on there are the following tasks that are left to do:

  1. Add KernelInfo's for the remaining kernels

    "adjust_brightness_image_tensor",
    "adjust_contrast_image_tensor",
    "adjust_gamma_image_tensor",
    "adjust_hue_image_tensor",
    "adjust_saturation_image_tensor",
    "clamp_bounding_box",
    "five_crop_image_tensor",
    "normalize_image_tensor",
    "ten_crop_image_tensor",

    Afterwards, this can also be used to add the DispatcherInfo's.

  2. Add dispatch tests for the dispatchers. Basically we need to make sure that

    1. if PIL.Image.Image gets passed, we dispatch to the PIL kernel
    2. if a simple tensor is passed, we dispatch to the image tensor kernel
    3. if a _Feature is passed we dispatch to the feature method
  3. Reduce the number of sample inputs since they are used for multiple tests:

    Overview

    kernel # sample inputs
    pad_image_tensor 2448
    pad_mask 864
    affine_image_tensor 480
    rotate_image_tensor 432
    center_crop_image_tensor 432
    resize_image_tensor 384
    crop_image_tensor 384
    center_crop_mask 324
    resize_mask 288
    convert_color_space_image_tensor 288
    crop_mask 288
    resized_crop_image_tensor 192
    convert_format_bounding_box 144
    resized_crop_mask 144
    pad_bounding_box 108
    center_crop_bounding_box 108
    perspective_image_tensor 80
    elastic_image_tensor 80
    affine_mask 72
    rotate_mask 72
    crop_bounding_box 72
    erase_image_tensor 48
    horizontal_flip_mask 36
    affine_bounding_box 36
    vertical_flip_mask 36
    rotate_bounding_box 36
    resized_crop_bounding_box 36
    perspective_bounding_box 36
    elastic_bounding_box 36
    gaussian_blur_image_tensor 32
    horizontal_flip_image_tensor 24
    resize_bounding_box 24
    vertical_flip_image_tensor 24
    invert_image_tensor 24
    solarize_image_tensor 24
    autocontrast_image_tensor 24
    adjust_sharpness_image_tensor 16
    perspective_mask 12
    elastic_mask 12
    posterize_image_tensor 12
    horizontal_flip_bounding_box 6
    vertical_flip_bounding_box 6
    equalize_image_tensor 4

  4. Port the remaining correctness tests into references of the new framework.

Copy link
Collaborator

@vfdev-5 vfdev-5 left a comment

Choose a reason for hiding this comment

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

Thanks @pmeier !

@pmeier pmeier merged commit 658ca53 into pytorch:main Sep 22, 2022
@pmeier pmeier deleted the test-cleanup branch September 22, 2022 09:06
facebook-github-bot pushed a commit that referenced this pull request Sep 23, 2022
Summary:
* cleanup prototype transforms functional tests

* fix

* oust local functions

Reviewed By: NicolasHug

Differential Revision: D39765311

fbshipit-source-id: 6351ea0e8ad485c6e03fed18b13d9698d432207e
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