Skip to content

Commit 5e58ea4

Browse files
Joao Gomesfacebook-github-bot
Joao Gomes
authored andcommitted
[fbsync] [prototype] Optimize and clean up all affine methods (#6945)
Summary: * Clean up `_get_inverse_affine_matrix` and `_compute_affine_output_size` * Optimize `_apply_grid_transform` * Cleanup `_assert_grid_transform_inputs` * Fix bugs on `_pad_with_scalar_fill` & `crop_mask` and port `crop_image_tensor` * Call directly `_pad_with_scalar_fill` * Fix linter * Clean up `center_crop_image_tensor` * Fix comments. * Fixing rounding issues. * Bumping tolerance for rotate which is unrelated to this PR. * Fix tolerance threshold for RandomPerspective. * Clean up `_affine_grid` and `affine_image_tensor` * Clean up `rotate_image_tensor` * Fixing linter * Address code-review comments. Reviewed By: YosuaMichael Differential Revision: D41376279 fbshipit-source-id: bc21d68d6374b39d78ae74ba01e49633b2d8d1e2
1 parent ea84b15 commit 5e58ea4

File tree

3 files changed

+265
-30
lines changed

3 files changed

+265
-30
lines changed

test/prototype_transforms_kernel_infos.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -915,7 +915,7 @@ def sample_inputs_rotate_video():
915915
reference_inputs_fn=reference_inputs_rotate_image_tensor,
916916
float32_vs_uint8=True,
917917
# TODO: investigate
918-
closeness_kwargs=pil_reference_pixel_difference(100, agg_method="mean"),
918+
closeness_kwargs=pil_reference_pixel_difference(110, agg_method="mean"),
919919
test_marks=[
920920
xfail_jit_tuple_instead_of_list("fill"),
921921
# TODO: check if this is a regression since it seems that should be supported if `int` is ok

test/test_prototype_transforms_consistency.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,7 @@ def __init__(
401401
ArgsKwargs(p=1, distortion_scale=0.1, fill=1),
402402
ArgsKwargs(p=1, distortion_scale=0.4, fill=(1, 2, 3)),
403403
],
404+
closeness_kwargs={"atol": None, "rtol": None},
404405
),
405406
ConsistencyConfig(
406407
prototype_transforms.RandomRotation,

0 commit comments

Comments
 (0)